use of io.swagger.v3.core.oas.models.Model1979 in project swagger-core by swagger-api.
the class EnumPropertyTest method testEnumRefPropertyGlobalNotAffectingNonEnums.
@Test(description = "it should not affect non-enum models when the enumsAsRef property is enabled globally")
public void testEnumRefPropertyGlobalNotAffectingNonEnums() {
ModelResolver.enumsAsRef = true;
Schema schema = context.resolve(new AnnotatedType(Model1979.class));
final Map<String, Schema> models = context.getDefinedModels();
final String yaml = "Model1979:\n" + " type: object\n" + " properties:\n" + " id:\n" + " type: string\n" + " nullable: true";
SerializationMatchers.assertEqualsToYaml(models, yaml);
ModelResolver.enumsAsRef = false;
}
use of io.swagger.v3.core.oas.models.Model1979 in project swagger-core by swagger-api.
the class ModelPropertyTest method modelAllowEmptyTest.
@Test
public void modelAllowEmptyTest() {
final Map<String, Schema> models = ModelConverters.getInstance().readAll(Model1979.class);
Schema model = models.get("Model1979");
assertTrue(((Schema) model.getProperties().get("id")).getNullable());
}
Aggregations