use of io.swagger.v3.oas.models.parameters.QueryParameter 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.parameters.QueryParameter in project swagger-core by swagger-api.
the class ParameterSerializationTest method testReadOnlyParameter.
@Test(description = "should mark a parameter as readOnly")
public void testReadOnlyParameter() throws Exception {
final QueryParameter qp = new QueryParameter();
qp.setSchema(new StringSchema().readOnly(true));
final String json = "{" + " \"in\":\"query\"," + " \"schema\":{" + " \"type\":\"string\"," + " \"readOnly\":true" + " }" + "}";
SerializationMatchers.assertEqualsToJson(qp, json);
}
Aggregations