Search in sources :

Example 1 with JacksonReadonlyModel

use of io.swagger.models.JacksonReadonlyModel in project swagger-core by swagger-api.

the class ModelConverterTest method setReadOnly.

@Test(description = "it should set readOnly per #854")
public void setReadOnly() {
    final Map<String, Model> schemas = readAll(JacksonReadonlyModel.class);
    final ModelImpl model = (ModelImpl) schemas.get("JacksonReadonlyModel");
    final Property prop = model.getProperties().get("count");
    assertTrue(prop.getReadOnly());
}
Also used : AbstractModelWithApiModel(io.swagger.models.composition.AbstractModelWithApiModel) Model(io.swagger.models.Model) ModelWithApiModel(io.swagger.models.ModelWithApiModel) EmptyModel(io.swagger.models.EmptyModel) JodaDateTimeModel(io.swagger.models.JodaDateTimeModel) JacksonReadonlyModel(io.swagger.models.JacksonReadonlyModel) ModelImpl(io.swagger.models.ModelImpl) StringProperty(io.swagger.models.properties.StringProperty) ArrayProperty(io.swagger.models.properties.ArrayProperty) LongProperty(io.swagger.models.properties.LongProperty) DecimalProperty(io.swagger.models.properties.DecimalProperty) Property(io.swagger.models.properties.Property) DoubleProperty(io.swagger.models.properties.DoubleProperty) MapProperty(io.swagger.models.properties.MapProperty) ApiModelProperty(io.swagger.annotations.ApiModelProperty) BaseIntegerProperty(io.swagger.models.properties.BaseIntegerProperty) ModelWithUrlProperty(io.swagger.models.composition.ModelWithUrlProperty) RefProperty(io.swagger.models.properties.RefProperty) FloatProperty(io.swagger.models.properties.FloatProperty) IntegerProperty(io.swagger.models.properties.IntegerProperty) Test(org.testng.annotations.Test)

Aggregations

ApiModelProperty (io.swagger.annotations.ApiModelProperty)1 EmptyModel (io.swagger.models.EmptyModel)1 JacksonReadonlyModel (io.swagger.models.JacksonReadonlyModel)1 JodaDateTimeModel (io.swagger.models.JodaDateTimeModel)1 Model (io.swagger.models.Model)1 ModelImpl (io.swagger.models.ModelImpl)1 ModelWithApiModel (io.swagger.models.ModelWithApiModel)1 AbstractModelWithApiModel (io.swagger.models.composition.AbstractModelWithApiModel)1 ModelWithUrlProperty (io.swagger.models.composition.ModelWithUrlProperty)1 ArrayProperty (io.swagger.models.properties.ArrayProperty)1 BaseIntegerProperty (io.swagger.models.properties.BaseIntegerProperty)1 DecimalProperty (io.swagger.models.properties.DecimalProperty)1 DoubleProperty (io.swagger.models.properties.DoubleProperty)1 FloatProperty (io.swagger.models.properties.FloatProperty)1 IntegerProperty (io.swagger.models.properties.IntegerProperty)1 LongProperty (io.swagger.models.properties.LongProperty)1 MapProperty (io.swagger.models.properties.MapProperty)1 Property (io.swagger.models.properties.Property)1 RefProperty (io.swagger.models.properties.RefProperty)1 StringProperty (io.swagger.models.properties.StringProperty)1