Required changes for Request mapping context
@@ -20,7 +20,6 @@ package springfox.documentation.spi.service.contexts;
import com.fasterxml.classmate.ResolvedType;
import com.google.common.base.Optional;
-import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Ordering;
import org.springframework.http.MediaType;
@@ -30,18 +29,16 @@ import org.springframework.web.servlet.mvc.condition.PatternsRequestCondition;
import springfox.documentation.RequestHandler;
import springfox.documentation.RequestHandlerKey;
import springfox.documentation.builders.ApiDescriptionBuilder;
-import springfox.documentation.schema.Model;
import springfox.documentation.service.Operation;
import springfox.documentation.service.ResolvedMethodParameter;
import springfox.documentation.spi.schema.GenericTypeNamingStrategy;
+import springfox.documentation.spi.schema.UniqueTypeNameAdjuster;
import java.lang.annotation.Annotation;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import static com.google.common.collect.Lists.newArrayList;
-import static com.google.common.collect.Maps.*;
public class RequestMappingContext {
private final OperationModelContextsBuilder operationModelContextsBuilder;
@@ -50,9 +47,9 @@ public class RequestMappingContext {
private final String requestMappingPattern;
private final ApiDescriptionBuilder apiDescriptionBuilder;
- private final Map<String, Model> modelMap = newHashMap();
-
- public RequestMappingContext(DocumentationContext context, RequestHandler handler) {
+ public RequestMappingContext(DocumentationContext context,
+ RequestHandler handler,
+ UniqueTypeNameAdjuster uniqueTypeNameAdjuster) {
this.documentationContext = context;
this.handler = handler;
@@ -60,6 +57,7 @@ public class RequestMappingContext {
this.operationModelContextsBuilder = new OperationModelContextsBuilder(
context.getGroupName(),
context.getDocumentationType(),
+ uniqueTypeNameAdjuster,
context.getAlternateTypeProvider(),
context.getGenericsNamingStrategy(),
context.getIgnorableParameterTypes());
@@ -79,21 +77,6 @@ public class RequestMappingContext {
this.apiDescriptionBuilder = new ApiDescriptionBuilder(documentationContext.operationOrdering());
}
- private RequestMappingContext(
- DocumentationContext context,
- RequestHandler handler,
- OperationModelContextsBuilder operationModelContextsBuilder,
- String requestMappingPattern,
- Map<String, Model> knownModels) {
-
- documentationContext = context;
- this.handler = handler;
- this.operationModelContextsBuilder = operationModelContextsBuilder;
- this.requestMappingPattern = requestMappingPattern;
- this.apiDescriptionBuilder = new ApiDescriptionBuilder(documentationContext.operationOrdering());
- modelMap.putAll(knownModels);
- }
-
public DocumentationContext getDocumentationContext() {
return documentationContext;
}
@@ -102,10 +85,6 @@ public class RequestMappingContext {
return requestMappingPattern;
}
- public ImmutableMap<String, Model> getModelMap() {
- return ImmutableMap.copyOf(modelMap);
- }
-
public OperationModelContextsBuilder operationModelsBuilder() {
return operationModelContextsBuilder;
}
@@ -127,11 +106,6 @@ public class RequestMappingContext {
requestMappingPattern);
}
- public RequestMappingContext withKnownModels(Map<String, Model> knownModels) {
- return new RequestMappingContext(documentationContext, handler,
- operationModelContextsBuilder, requestMappingPattern, knownModels);
- }
-
public ImmutableSet<Class> getIgnorableParameterTypes() {
return documentationContext.getIgnorableParameterTypes();
}
