use of io.servicecomb.swagger.extend.parameter.PendingBodyParameter in project java-chassis by ServiceComb.
the class ParamUtils method createPendingBodyParameter.
public static PendingBodyParameter createPendingBodyParameter(OperationGenerator operationGenerator, String paramName, Type paramType) {
addDefinitions(operationGenerator.getSwagger(), paramType);
Property property = ModelConverters.getInstance().readAsProperty(paramType);
PendingBodyParameter pendingBodyParameter = new PendingBodyParameter();
pendingBodyParameter.setName(paramName);
pendingBodyParameter.setProperty(property);
pendingBodyParameter.setType(paramType);
pendingBodyParameter.setOperationGenerator(operationGenerator);
return pendingBodyParameter;
}
use of io.servicecomb.swagger.extend.parameter.PendingBodyParameter in project java-chassis by ServiceComb.
the class DefaultBodyParamProcessor method process.
@Override
public void process(OperationGenerator operationGenerator, int paramIndex) {
PendingBodyParameter pendingBodyParameter = ParamUtils.createPendingBodyParameter(operationGenerator, paramIndex);
operationGenerator.addProviderParameter(pendingBodyParameter);
}
use of io.servicecomb.swagger.extend.parameter.PendingBodyParameter in project java-chassis by ServiceComb.
the class OperationGenerator method replaceBodyBasedParameter.
protected void replaceBodyBasedParameter(Parameter bodyBasedParameter) {
if (ParamUtils.isRealBodyParameter(bodyBasedParameter)) {
return;
}
int idx = swaggerParameters.indexOf(bodyBasedParameter);
String bodyParamName = bodyBasedParameter.getName();
BodyParameter bodyParameter = ((PendingBodyParameter) bodyBasedParameter).createBodyParameter(bodyParamName);
swaggerParameters.set(idx, bodyParameter);
}
use of io.servicecomb.swagger.extend.parameter.PendingBodyParameter in project java-chassis by ServiceComb.
the class RequestBodyAnnotationProcessor method process.
@Override
public void process(Object annotation, OperationGenerator operationGenerator, int paramIdx) {
PendingBodyParameter pendingBodyParameter = ParamUtils.createPendingBodyParameter(operationGenerator, paramIdx);
operationGenerator.addProviderParameter(pendingBodyParameter);
}
Aggregations