Search in sources :

Example 1 with Ticket2862Model

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

the class Ticket2862SubtypeTest method testSubType.

@Test
public void testSubType() throws Exception {
    final ModelResolver modelResolver = new ModelResolver(mapper());
    final ModelConverterContextImpl context = new ModelConverterContextImpl(modelResolver);
    final Schema model = context.resolve(new AnnotatedType(Ticket2862Model.class));
    SerializationMatchers.assertEqualsToYaml(context.getDefinedModels(), "Ticket2862Model:\n" + "  type: object\n" + "  properties:\n" + "    Ticket2862Model:\n" + "      type: object\n" + "Ticket2862ModelImpl:\n" + "  type: string\n" + "  allOf:\n" + "  - $ref: '#/components/schemas/Ticket2862Model'\n" + "  enum:\n" + "  - VALUE1\n" + "  - VALUE2\n");
}
Also used : AnnotatedType(io.swagger.v3.core.converter.AnnotatedType) Schema(io.swagger.v3.oas.models.media.Schema) Ticket2862Model(io.swagger.v3.core.resolving.resources.Ticket2862Model) 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 Ticket2862Model (io.swagger.v3.core.resolving.resources.Ticket2862Model)1 Schema (io.swagger.v3.oas.models.media.Schema)1 Test (org.testng.annotations.Test)1