Search in sources :

Example 46 with ModelImpl

use of io.swagger.models.ModelImpl in project carbon-apimgt by wso2.

the class APIDefinitionFromSwagger20 method getDefaultBodyParameter.

private BodyParameter getDefaultBodyParameter() {
    BodyParameter bodyParameter = new BodyParameter();
    bodyParameter.setName("Payload");
    bodyParameter.setDescription("Request Body");
    bodyParameter.setRequired(false);
    Model model = new ModelImpl();
    Map<String, Property> properties = new HashMap<>();
    Property property = new StringProperty();
    properties.put("payload", property);
    model.setProperties(properties);
    bodyParameter.setSchema(model);
    return bodyParameter;
}
Also used : ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) Model(io.swagger.models.Model) StringProperty(io.swagger.models.properties.StringProperty) BodyParameter(io.swagger.models.parameters.BodyParameter) ModelImpl(io.swagger.models.ModelImpl) StringProperty(io.swagger.models.properties.StringProperty) Property(io.swagger.models.properties.Property)

Aggregations

ModelImpl (io.swagger.models.ModelImpl)46 Test (org.testng.annotations.Test)37 Model (io.swagger.models.Model)24 Property (io.swagger.models.properties.Property)17 StringProperty (io.swagger.models.properties.StringProperty)16 ArrayProperty (io.swagger.models.properties.ArrayProperty)12 IntegerProperty (io.swagger.models.properties.IntegerProperty)11 RefProperty (io.swagger.models.properties.RefProperty)9 Xml (io.swagger.models.Xml)8 RefModel (io.swagger.models.RefModel)7 BodyParameter (io.swagger.models.parameters.BodyParameter)7 LongProperty (io.swagger.models.properties.LongProperty)7 MapProperty (io.swagger.models.properties.MapProperty)7 ApiModel (io.swagger.annotations.ApiModel)6 ApiModelProperty (io.swagger.annotations.ApiModelProperty)6 JsonProperty (com.fasterxml.jackson.annotation.JsonProperty)5 ComposedModel (io.swagger.models.ComposedModel)5 EmptyModel (io.swagger.models.EmptyModel)4 JacksonReadonlyModel (io.swagger.models.JacksonReadonlyModel)4 JodaDateTimeModel (io.swagger.models.JodaDateTimeModel)4