Search in sources :

Example 1 with PendingBodyParameter

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;
}
Also used : PendingBodyParameter(io.servicecomb.swagger.extend.parameter.PendingBodyParameter) MapProperty(com.fasterxml.jackson.databind.ser.std.MapProperty) ArrayProperty(io.swagger.models.properties.ArrayProperty) ObjectProperty(io.swagger.models.properties.ObjectProperty) RefProperty(io.swagger.models.properties.RefProperty) Property(io.swagger.models.properties.Property)

Example 2 with 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);
}
Also used : PendingBodyParameter(io.servicecomb.swagger.extend.parameter.PendingBodyParameter)

Example 3 with 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);
}
Also used : PendingBodyParameter(io.servicecomb.swagger.extend.parameter.PendingBodyParameter) PendingBodyParameter(io.servicecomb.swagger.extend.parameter.PendingBodyParameter) BodyParameter(io.swagger.models.parameters.BodyParameter)

Example 4 with PendingBodyParameter

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);
}
Also used : PendingBodyParameter(io.servicecomb.swagger.extend.parameter.PendingBodyParameter)

Aggregations

PendingBodyParameter (io.servicecomb.swagger.extend.parameter.PendingBodyParameter)4 MapProperty (com.fasterxml.jackson.databind.ser.std.MapProperty)1 BodyParameter (io.swagger.models.parameters.BodyParameter)1 ArrayProperty (io.swagger.models.properties.ArrayProperty)1 ObjectProperty (io.swagger.models.properties.ObjectProperty)1 Property (io.swagger.models.properties.Property)1 RefProperty (io.swagger.models.properties.RefProperty)1