Search in sources :

Example 1 with TestObject2915

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

the class Ticket2915Test method testPropertyName.

@Test
public void testPropertyName() throws Exception {
    final ModelResolver modelResolver = new ModelResolver(mapper());
    final ModelConverterContextImpl context = new ModelConverterContextImpl(modelResolver);
    final Schema model = context.resolve(new AnnotatedType(TestObject2915.class));
    SerializationMatchers.assertEqualsToYaml(context.getDefinedModels(), "QuantitativeValue:\n" + "  required:\n" + "  - value\n" + "  type: object\n" + "  properties:\n" + "    value:\n" + "      type: number\n" + "      format: double\n" + "    unitText:\n" + "      type: string\n" + "    unitCode:\n" + "      type: string\n" + "  description: A combination of a value and associated unit\n" + "TestObject2616:\n" + "  type: object\n" + "  properties:\n" + "    name:\n" + "      type: string\n" + "    perServing:\n" + "      $ref: '#/components/schemas/QuantitativeValue'\n" + "    per100Gram:\n" + "      $ref: '#/components/schemas/QuantitativeValue'\n" + "  description: Nutritional value specification");
}
Also used : AnnotatedType(io.swagger.v3.core.converter.AnnotatedType) TestObject2915(io.swagger.v3.core.resolving.resources.TestObject2915) Schema(io.swagger.v3.oas.models.media.Schema) 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 TestObject2915 (io.swagger.v3.core.resolving.resources.TestObject2915)1 Schema (io.swagger.v3.oas.models.media.Schema)1 Test (org.testng.annotations.Test)1