Search in sources :

Example 1 with BinaryProperty

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

the class ByteConverterTest method testReadOnlyByteArray.

@Test
public void testReadOnlyByteArray() {
    Model model = new ModelImpl().property("byteArray", new ArrayProperty(new BinaryProperty()).readOnly());
    assertEquals(Json.pretty(model), "{" + NEWLINE + "  \"properties\" : {" + NEWLINE + "    \"byteArray\" : {" + NEWLINE + "      \"type\" : \"array\"," + NEWLINE + "      \"readOnly\" : true," + NEWLINE + "      \"items\" : {" + NEWLINE + "        \"type\" : \"string\"," + NEWLINE + "        \"format\" : \"binary\"" + NEWLINE + "      }" + NEWLINE + "    }" + NEWLINE + "  }" + NEWLINE + "}");
}
Also used : ByteArrayProperty(io.swagger.models.properties.ByteArrayProperty) ArrayProperty(io.swagger.models.properties.ArrayProperty) Model(io.swagger.models.Model) BinaryProperty(io.swagger.models.properties.BinaryProperty) ModelImpl(io.swagger.models.ModelImpl) Test(org.testng.annotations.Test)

Example 2 with BinaryProperty

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

the class ByteConverterTest method testByteArray.

@Test
public void testByteArray() {
    Model model = new ModelImpl().property("byteArray", new ArrayProperty(new BinaryProperty()));
    assertEquals(Json.pretty(model), "{" + NEWLINE + "  \"properties\" : {" + NEWLINE + "    \"byteArray\" : {" + NEWLINE + "      \"type\" : \"array\"," + NEWLINE + "      \"items\" : {" + NEWLINE + "        \"type\" : \"string\"," + NEWLINE + "        \"format\" : \"binary\"" + NEWLINE + "      }" + NEWLINE + "    }" + NEWLINE + "  }" + NEWLINE + "}");
}
Also used : ByteArrayProperty(io.swagger.models.properties.ByteArrayProperty) ArrayProperty(io.swagger.models.properties.ArrayProperty) Model(io.swagger.models.Model) BinaryProperty(io.swagger.models.properties.BinaryProperty) ModelImpl(io.swagger.models.ModelImpl) Test(org.testng.annotations.Test)

Aggregations

Model (io.swagger.models.Model)2 ModelImpl (io.swagger.models.ModelImpl)2 ArrayProperty (io.swagger.models.properties.ArrayProperty)2 BinaryProperty (io.swagger.models.properties.BinaryProperty)2 ByteArrayProperty (io.swagger.models.properties.ByteArrayProperty)2 Test (org.testng.annotations.Test)2