Search in sources :

Example 1 with TestObject2972

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

the class Ticket2972Test method testLocalTime.

@Test
public void testLocalTime() throws Exception {
    final ModelResolver modelResolver = new ModelResolver(mapper());
    ModelConverterContextImpl context = new ModelConverterContextImpl(modelResolver);
    Schema model = context.resolve(new AnnotatedType(TestObject2972.class));
    SerializationMatchers.assertEqualsToYaml(context.getDefinedModels(), "TestObject2972:\n" + "  type: object\n" + "  properties:\n" + "    myField1:\n" + "      type: object\n" + "      additionalProperties:\n" + "        type: string\n" + "    myField2:\n" + "      type: object\n" + "      additionalProperties:\n" + "        type: string");
}
Also used : AnnotatedType(io.swagger.v3.core.converter.AnnotatedType) Schema(io.swagger.v3.oas.models.media.Schema) TestObject2972(io.swagger.v3.core.resolving.resources.TestObject2972) 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 TestObject2972 (io.swagger.v3.core.resolving.resources.TestObject2972)1 Schema (io.swagger.v3.oas.models.media.Schema)1 Test (org.testng.annotations.Test)1