Search in sources :

Example 1 with Ticket2884Model

use of io.swagger.v3.core.resolving.resources.Ticket2884Model 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");
}
Also used : AnnotatedType(io.swagger.v3.core.converter.AnnotatedType) Ticket2884Model(io.swagger.v3.core.resolving.resources.Ticket2884Model) Schema(io.swagger.v3.oas.models.media.Schema) Ticket2884ModelClass(io.swagger.v3.core.resolving.resources.Ticket2884ModelClass) 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 Ticket2884Model (io.swagger.v3.core.resolving.resources.Ticket2884Model)1 Ticket2884ModelClass (io.swagger.v3.core.resolving.resources.Ticket2884ModelClass)1 Schema (io.swagger.v3.oas.models.media.Schema)1 Test (org.testng.annotations.Test)1