use of io.swagger.v3.oas.models.media.IntegerSchema in project swagger-core by swagger-api.
the class ParameterSerializationTest method testIncorrectLong.
@Test(description = "should not serialize incorrect long value")
public void testIncorrectLong() {
final QueryParameter param = (QueryParameter) new QueryParameter().required(false);
Schema schema = new IntegerSchema().format("int64");
schema.setDefault("test");
param.setSchema(schema);
final String json = "{" + " \"in\":\"query\"," + " \"required\":false," + " \"schema\":{" + " \"type\":\"integer\"," + " \"format\":\"int64\"" + " }" + "}";
SerializationMatchers.assertEqualsToJson(param, json);
}
use of io.swagger.v3.oas.models.media.IntegerSchema in project swagger-core by swagger-api.
the class ParameterSerializationTest method serializeIntegerArrayPathParameter.
@Test(description = "it should serialize a PathParameter with integer array")
public void serializeIntegerArrayPathParameter() {
final Parameter p = new PathParameter().schema(new ArraySchema().items(new IntegerSchema()));
final String json = "{\"in\":\"path\",\"required\":true,\"schema\":{\"type\":\"array\",\"items\":{\"type\":\"integer\",\"format\":\"int32\"}}}\n";
SerializationMatchers.assertEqualsToJson(p, json);
}
use of io.swagger.v3.oas.models.media.IntegerSchema in project swagger-core by swagger-api.
the class PropertySerializationTest method serializeIntegerProperty.
@Test(description = "it should serialize an IntegerProperty")
public void serializeIntegerProperty() throws IOException {
final IntegerSchema p = new IntegerSchema()._default(32);
final String json = "{\"type\":\"integer\",\"format\":\"int32\",\"default\":32}";
assertEquals(m.writeValueAsString(p), json);
}
Aggregations