Search in sources :

Example 6 with DateTimeSchema

use of io.swagger.v3.oas.models.media.DateTimeSchema in project swagger-core by swagger-api.

the class PropertySerializationTest method serializeDateTimeProperty.

@Test(description = "it should serialize a DateTimeProperty")
public void serializeDateTimeProperty() throws IOException {
    final DateTimeSchema p = new DateTimeSchema();
    final String json = "{\"type\":\"string\",\"format\":\"date-time\"}";
    assertEquals(m.writeValueAsString(p), json);
}
Also used : DateTimeSchema(io.swagger.v3.oas.models.media.DateTimeSchema) Test(org.testng.annotations.Test)

Aggregations

DateTimeSchema (io.swagger.v3.oas.models.media.DateTimeSchema)6 Schema (io.swagger.v3.oas.models.media.Schema)5 Test (org.testng.annotations.Test)5 StringSchema (io.swagger.v3.oas.models.media.StringSchema)4 DateSchema (io.swagger.v3.oas.models.media.DateSchema)2 JavaType (com.fasterxml.jackson.databind.JavaType)1 ArraySchema (io.swagger.v3.oas.models.media.ArraySchema)1 IntegerSchema (io.swagger.v3.oas.models.media.IntegerSchema)1 LinkedHashMap (java.util.LinkedHashMap)1