use of io.swagger.v3.core.converter.ModelConverterContextImpl in project swagger-core by swagger-api.
the class Ticket2884Test method test2884.
@Test
public void test2884() throws Exception {
final ModelResolver modelResolver = new ModelResolver(mapper());
ModelConverterContextImpl context = new ModelConverterContextImpl(modelResolver);
Ticket2884ModelClass a = new Ticket2884ModelClass();
Schema model = context.resolve(new AnnotatedType(Ticket2884Model.class));
SerializationMatchers.assertEqualsToYaml(context.getDefinedModels(), "Ticket2884Model:\n" + " type: object\n" + " properties:\n" + " Ticket2884Model:\n" + " type: object");
context = new ModelConverterContextImpl(modelResolver);
model = context.resolve(new AnnotatedType(Ticket2884ModelClass.class));
SerializationMatchers.assertEqualsToYaml(context.getDefinedModels(), "Ticket2884ModelClass:\n" + " type: object\n" + " properties:\n" + " Ticket2884ModelClass:\n" + " type: object\n" + " properties:\n" + " bar:\n" + " type: string\n" + " foo:\n" + " type: array\n" + " items:\n" + " type: string\n");
}
use of io.swagger.v3.core.converter.ModelConverterContextImpl in project swagger-core by swagger-api.
the class Ticket3348Test method beforeMethod.
@BeforeMethod
public void beforeMethod() {
modelResolver = new ModelResolver(new ObjectMapper());
context = new ModelConverterContextImpl(modelResolver);
}
use of io.swagger.v3.core.converter.ModelConverterContextImpl in project swagger-core by swagger-api.
the class Ticket3624Test method testSelfReferencingOptional.
@Test
public void testSelfReferencingOptional() throws Exception {
final ModelResolver modelResolver = new ModelResolver(mapper());
ModelConverterContextImpl context = new ModelConverterContextImpl(modelResolver);
Schema model = context.resolve(new AnnotatedType(ModelContainer.class));
Yaml.prettyPrint(context.getDefinedModels());
SerializationMatchers.assertEqualsToYaml(context.getDefinedModels(), "Model:\n" + " type: object\n" + " properties:\n" + " model:\n" + " $ref: '#/components/schemas/Model'\n" + "ModelContainer:\n" + " type: object\n" + " properties:\n" + " model:\n" + " $ref: '#/components/schemas/Model'\n");
}
use of io.swagger.v3.core.converter.ModelConverterContextImpl in project swagger-core by swagger-api.
the class Ticket3703Test method testSelfReferencingOptional.
@Test
public void testSelfReferencingOptional() throws Exception {
final ModelResolver modelResolver = new ModelResolver(mapper());
ModelConverterContextImpl context = new ModelConverterContextImpl(modelResolver);
Schema model = context.resolve(new AnnotatedType(ModelContainer.class));
SerializationMatchers.assertEqualsToYaml(context.getDefinedModels(), "Model:\n" + " type: object\n" + " properties:\n" + " model:\n" + " $ref: '#/components/schemas/Model'\n" + "ModelContainer:\n" + " type: object\n" + " properties:\n" + " model:\n" + " $ref: '#/components/schemas/Model'\n" + " bytes:\n" + " type: string\n" + " format: byte");
}
use of io.swagger.v3.core.converter.ModelConverterContextImpl in project swagger-core by swagger-api.
the class Ticket3030Test method setup.
@BeforeTest
public void setup() {
modelResolver = new ModelResolver(new ObjectMapper());
context = new ModelConverterContextImpl(modelResolver);
}
Aggregations