Search in sources :

Example 1 with MyThing

use of io.swagger.v3.core.resolving.resources.MyThing in project swagger-core by swagger-api.

the class Ticket2740CyclicTest method testCyclicBean.

@Test
public void testCyclicBean() throws Exception {
    final ModelResolver modelResolver = new ModelResolver(mapper());
    final ModelConverterContextImpl context = new ModelConverterContextImpl(modelResolver);
    final Schema model = context.resolve(new AnnotatedType(MyThing.class));
    SerializationMatchers.assertEqualsToYaml(model, "type: object\n" + "properties:\n" + "  otherThings:\n" + "    uniqueItems: true\n" + "    type: array\n" + "    description: Other related things\n" + "    items:\n" + "      $ref: '#/components/schemas/MyThing'\n" + "description: Thing");
}
Also used : AnnotatedType(io.swagger.v3.core.converter.AnnotatedType) Schema(io.swagger.v3.oas.models.media.Schema) MyThing(io.swagger.v3.core.resolving.resources.MyThing) ModelConverterContextImpl(io.swagger.v3.core.converter.ModelConverterContextImpl) ModelResolver(io.swagger.v3.core.jackson.ModelResolver) Test(org.testng.annotations.Test)

Aggregations

AnnotatedType (io.swagger.v3.core.converter.AnnotatedType)1 ModelConverterContextImpl (io.swagger.v3.core.converter.ModelConverterContextImpl)1 ModelResolver (io.swagger.v3.core.jackson.ModelResolver)1 MyThing (io.swagger.v3.core.resolving.resources.MyThing)1 Schema (io.swagger.v3.oas.models.media.Schema)1 Test (org.testng.annotations.Test)1