public abstract class AbstractArgumentsMapperCreator extends Object
1.common
context type parameter is not swagger parameter:
InvocationContext
HttpServletRequest
2.same version
1) direct map (most scenes)
interface method:
class AddParam {
int x;
int y;
}
int add(InvocationContext context, AddParam param)
swagger parameters:
param
interface method:
int add(int x, int y)
swagger parameters:
x, y
2) swagger only one POJO paramter, extract all field to method parameters (POJO dev mode)
interface method:
int add(int x, int y)
swagger parameters:
param
3) wrap some simple continuously swagger parameters to POJO (springmvc query parameters)
interface method:
int add(String name, AddParam param, Body body)
swagger parameters:
name, x, y, body
4) wrap some simple and complex continuously swagger parameters to POJO (JaxRS BeanParam)
interface method:
class BeanWrapper {
int x;
int y;
Body body;
}
int add(String name, AddParam param, Body body)
swagger parameters:
name, x, y, body
2. invoke old version
interface method:
int add(int x, int y, int z)
swagger parameter:
x, y
3. invoke new version
interface method:
int add(int x, int y)
swagger parameter:
x, y, z
| Modifier and Type | Field and Description |
|---|---|
protected io.swagger.models.parameters.BodyParameter |
bodyParameter |
protected Map<Class<?>,ContextArgumentMapperFactory> |
contextFactorys |
protected List<ArgumentMapper> |
mappers |
protected Set<String> |
processedSwaggerParamters |
protected Class<?> |
providerClass |
protected Method |
providerMethod |
protected com.fasterxml.jackson.databind.SerializationConfig |
serializationConfig |
protected int |
swaggerBodyIdx |
protected Map<String,io.swagger.models.properties.Property> |
swaggerBodyProperties |
protected SwaggerOperation |
swaggerOperation |
protected List<io.swagger.models.parameters.Parameter> |
swaggerParameters |
| Constructor and Description |
|---|
AbstractArgumentsMapperCreator(com.fasterxml.jackson.databind.SerializationConfig serializationConfig,
Map<Class<?>,ContextArgumentMapperFactory> contextFactorys,
Class<?> providerClass,
Method providerMethod,
SwaggerOperation swaggerOperation) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract ArgumentMapper |
createKnownParameterMapper(int providerParamIdx,
Integer swaggerIdx) |
protected abstract ArgumentMapper |
createSwaggerBodyFieldMapper(int providerParamIdx,
String parameterName,
int swaggerBodyIdx) |
protected void |
doCreateArgumentsMapper() |
protected Integer |
findSwaggerParameterIndex(String name) |
protected abstract void |
processBeanParameter(int providerParamIdx,
Parameter providerParameter) |
protected boolean |
processContextParameter(int providerParamIdx,
Parameter providerParameter) |
protected boolean |
processKnownParameter(int providerParamIdx,
Parameter providerParameter,
String parameterName) |
protected abstract void |
processPendingSwaggerParameter(io.swagger.models.parameters.Parameter parameter) |
protected boolean |
processSwaggerBodyField(int providerParamIdx,
Parameter providerParameter,
String parameterName) |
protected abstract void |
processUnknownParameter(String parameterName) |
protected com.fasterxml.jackson.databind.SerializationConfig serializationConfig
protected Map<Class<?>,ContextArgumentMapperFactory> contextFactorys
protected Method providerMethod
protected Class<?> providerClass
protected SwaggerOperation swaggerOperation
protected List<ArgumentMapper> mappers
protected List<io.swagger.models.parameters.Parameter> swaggerParameters
protected int swaggerBodyIdx
protected io.swagger.models.parameters.BodyParameter bodyParameter
protected Map<String,io.swagger.models.properties.Property> swaggerBodyProperties
public AbstractArgumentsMapperCreator(com.fasterxml.jackson.databind.SerializationConfig serializationConfig,
Map<Class<?>,ContextArgumentMapperFactory> contextFactorys,
Class<?> providerClass,
Method providerMethod,
SwaggerOperation swaggerOperation)
protected void doCreateArgumentsMapper()
protected boolean processContextParameter(int providerParamIdx,
Parameter providerParameter)
providerParamIdx - providerParameter - processing provider parameterprotected boolean processKnownParameter(int providerParamIdx,
Parameter providerParameter,
String parameterName)
providerParamIdx - providerParameter - processing provider parameterparameterName - protected abstract ArgumentMapper createKnownParameterMapper(int providerParamIdx, Integer swaggerIdx)
protected boolean processSwaggerBodyField(int providerParamIdx,
Parameter providerParameter,
String parameterName)
protected abstract ArgumentMapper createSwaggerBodyFieldMapper(int providerParamIdx, String parameterName, int swaggerBodyIdx)
protected abstract void processBeanParameter(int providerParamIdx,
Parameter providerParameter)
providerParamIdx - providerParameter - processing provider parameterprotected abstract void processUnknownParameter(String parameterName)
protected abstract void processPendingSwaggerParameter(io.swagger.models.parameters.Parameter parameter)
Copyright © 2017–2020 The Apache Software Foundation. All rights reserved.