Search in sources :

Example 61 with StringProperty

use of io.swagger.models.properties.StringProperty in project cxf by apache.

the class JaxRs2Extension method enforcePrimitive.

private Property enforcePrimitive(final Property in, final int level) {
    if (in instanceof RefProperty) {
        return new StringProperty();
    }
    if (in instanceof ArrayProperty) {
        if (level == 0) {
            final ArrayProperty array = (ArrayProperty) in;
            array.setItems(enforcePrimitive(array.getItems(), level + 1));
        } else {
            return new StringProperty();
        }
    }
    return in;
}
Also used : ArrayProperty(io.swagger.models.properties.ArrayProperty) StringProperty(io.swagger.models.properties.StringProperty) RefProperty(io.swagger.models.properties.RefProperty)

Example 62 with StringProperty

use of io.swagger.models.properties.StringProperty 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

StringProperty (io.swagger.models.properties.StringProperty)62 Test (org.testng.annotations.Test)47 Property (io.swagger.models.properties.Property)30 ArrayProperty (io.swagger.models.properties.ArrayProperty)22 Model (io.swagger.models.Model)21 RefProperty (io.swagger.models.properties.RefProperty)17 IntegerProperty (io.swagger.models.properties.IntegerProperty)16 LongProperty (io.swagger.models.properties.LongProperty)16 DoubleProperty (io.swagger.models.properties.DoubleProperty)14 ModelImpl (io.swagger.models.ModelImpl)10 FloatProperty (io.swagger.models.properties.FloatProperty)9 BodyParameter (io.swagger.models.parameters.BodyParameter)8 BooleanProperty (io.swagger.models.properties.BooleanProperty)8 ApiModelProperty (io.swagger.annotations.ApiModelProperty)7 MapProperty (io.swagger.models.properties.MapProperty)7 Operation (io.swagger.models.Operation)6 Path (io.swagger.models.Path)6 PathParameter (io.swagger.models.parameters.PathParameter)6 ObjectProperty (io.swagger.models.properties.ObjectProperty)6 QueryParameter (io.swagger.models.parameters.QueryParameter)5