Search in sources :

Example 41 with ArrayProperty

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

the class ModelImplTest method testClone.

@Test
public void testClone() {
    // given
    propertiesAndValues = new Object[] { "additionalProperties", new ArrayProperty(), "description", "description", "discriminator", "discriminator", "example", new Object(), "isSimple", true, "name", "name", "properties", new HashMap<String, Property>(), "required", new ArrayList<String>(), "type", "type", "xml", new Xml(), "defaultValue", "defaultValue" };
    TestUtils.testClone(instance, propertiesAndValues);
}
Also used : ArrayProperty(io.swagger.models.properties.ArrayProperty) ArrayProperty(io.swagger.models.properties.ArrayProperty) Property(io.swagger.models.properties.Property) Test(org.testng.annotations.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 42 with ArrayProperty

use of io.swagger.models.properties.ArrayProperty in project java-chassis by ServiceComb.

the class TestApiOperation method testSet.

private void testSet(Path path) {
    Operation operation = path.getPost();
    Property result200 = operation.getResponses().get("200").getSchema();
    Assert.assertEquals(ArrayProperty.class, result200.getClass());
    Assert.assertEquals(true, ((ArrayProperty) result200).getUniqueItems());
}
Also used : ApiOperation(io.swagger.annotations.ApiOperation) Operation(io.swagger.models.Operation) MapProperty(io.swagger.models.properties.MapProperty) ExtensionProperty(io.swagger.annotations.ExtensionProperty) ArrayProperty(io.swagger.models.properties.ArrayProperty) Property(io.swagger.models.properties.Property)

Example 43 with ArrayProperty

use of io.swagger.models.properties.ArrayProperty in project java-chassis by ServiceComb.

the class TestApiOperation method testList.

private void testList(Path path) {
    Operation operation = path.getPost();
    Property result200 = operation.getResponses().get("200").getSchema();
    Assert.assertEquals(ArrayProperty.class, result200.getClass());
    Assert.assertEquals(null, ((ArrayProperty) result200).getUniqueItems());
}
Also used : ApiOperation(io.swagger.annotations.ApiOperation) Operation(io.swagger.models.Operation) MapProperty(io.swagger.models.properties.MapProperty) ExtensionProperty(io.swagger.annotations.ExtensionProperty) ArrayProperty(io.swagger.models.properties.ArrayProperty) Property(io.swagger.models.properties.Property)

Aggregations

ArrayProperty (io.swagger.models.properties.ArrayProperty)43 Property (io.swagger.models.properties.Property)30 Test (org.testng.annotations.Test)30 StringProperty (io.swagger.models.properties.StringProperty)23 Model (io.swagger.models.Model)14 MapProperty (io.swagger.models.properties.MapProperty)14 IntegerProperty (io.swagger.models.properties.IntegerProperty)12 RefProperty (io.swagger.models.properties.RefProperty)12 ModelImpl (io.swagger.models.ModelImpl)8 DoubleProperty (io.swagger.models.properties.DoubleProperty)7 LongProperty (io.swagger.models.properties.LongProperty)7 Operation (io.swagger.models.Operation)6 ByteArrayProperty (io.swagger.models.properties.ByteArrayProperty)6 FloatProperty (io.swagger.models.properties.FloatProperty)5 ApiModelProperty (io.swagger.annotations.ApiModelProperty)4 AbstractNumericProperty (io.swagger.models.properties.AbstractNumericProperty)4 BaseIntegerProperty (io.swagger.models.properties.BaseIntegerProperty)4 BooleanProperty (io.swagger.models.properties.BooleanProperty)4 DecimalProperty (io.swagger.models.properties.DecimalProperty)4 Annotation (java.lang.annotation.Annotation)4