Search in sources :

Example 86 with Parameter

use of io.swagger.models.parameters.Parameter in project java-chassis by ServiceComb.

the class ArgumentsMapperFactory method collectContextArgumentsMapper.

protected void collectContextArgumentsMapper(ArgumentsMapperConfig config) {
    for (int providerIdx = 0; providerIdx < config.getProviderParameters().size(); providerIdx++) {
        Parameter providerParameter = config.getProviderParameters().get(providerIdx);
        if (!ContextParameter.class.isInstance(providerParameter)) {
            continue;
        }
        ContextArgumentMapperFactory factory = findFactory(providerParameter.getClass());
        if (factory != null) {
            ArgumentMapper mapper = factory.create(providerIdx);
            config.addArgumentMapper(mapper);
            continue;
        }
        throw new Error("unknown context parameter " + providerParameter.getClass().getName());
    }
}
Also used : ContextParameter(io.servicecomb.swagger.extend.parameter.ContextParameter) BodyParameter(io.swagger.models.parameters.BodyParameter) Parameter(io.swagger.models.parameters.Parameter) ContextParameter(io.servicecomb.swagger.extend.parameter.ContextParameter)

Aggregations

Parameter (io.swagger.models.parameters.Parameter)86 BodyParameter (io.swagger.models.parameters.BodyParameter)50 Test (org.testng.annotations.Test)50 QueryParameter (io.swagger.models.parameters.QueryParameter)48 PathParameter (io.swagger.models.parameters.PathParameter)47 HeaderParameter (io.swagger.models.parameters.HeaderParameter)38 Swagger (io.swagger.models.Swagger)30 FormParameter (io.swagger.models.parameters.FormParameter)23 Operation (io.swagger.models.Operation)17 SerializableParameter (io.swagger.models.parameters.SerializableParameter)15 Type (java.lang.reflect.Type)13 ArrayList (java.util.ArrayList)10 Annotation (java.lang.annotation.Annotation)9 Method (java.lang.reflect.Method)9 JavaType (com.fasterxml.jackson.databind.JavaType)7 ContextParameter (io.servicecomb.swagger.extend.parameter.ContextParameter)6 Path (io.swagger.models.Path)6 AnnotatedParameter (com.fasterxml.jackson.databind.introspect.AnnotatedParameter)5 Reader (io.swagger.jaxrs.Reader)5 Response (io.swagger.models.Response)4