diff --git a/modules/swagger-core/src/main/java/io/swagger/v3/core/util/AnnotationsUtils.java b/modules/swagger-core/src/main/java/io/swagger/v3/core/util/AnnotationsUtils.java index 9d7d625b80..27c0a042ba 100644 --- a/modules/swagger-core/src/main/java/io/swagger/v3/core/util/AnnotationsUtils.java +++ b/modules/swagger-core/src/main/java/io/swagger/v3/core/util/AnnotationsUtils.java @@ -90,7 +90,7 @@ public static boolean hasSchemaAnnotation(io.swagger.v3.oas.annotations.media.Sc && schema.accessMode().equals(io.swagger.v3.oas.annotations.media.Schema.AccessMode.AUTO) && !schema.deprecated() && schema.allowableValues().length == 0 - && StringUtils.isBlank(schema.defaultValue()) +// && StringUtils.isBlank(schema.defaultValue()) && schema.implementation().equals(Void.class) && StringUtils.isBlank(schema.example()) && StringUtils.isBlank(schema.pattern()) @@ -597,6 +597,8 @@ public static Optional getSchemaFromAnnotation( Schema existingSchema, Schema.SchemaResolution schemaResolution, ModelConverterContext context) { + System.out.println("조건 검사"); + System.out.println(schema); if (schema == null || !hasSchemaAnnotation(schema)) { if (existingSchema == null || (!openapi31 && Schema.SchemaResolution.DEFAULT.equals(schemaResolution))) { return Optional.empty(); @@ -604,6 +606,7 @@ public static Optional getSchemaFromAnnotation( return Optional.of(existingSchema); } } + System.out.println("조건 통과"); Schema schemaObject = null; if (!openapi31) { if (existingSchema != null) { @@ -751,8 +754,8 @@ public static Optional getSchemaFromAnnotation( if (schema.examples().length > 0) { schemaObject.setExamples(Arrays.asList(schema.examples())); } - - if (StringUtils.isNotBlank(schema.defaultValue())) { + if (schema.defaultValue() != null) { + System.out.println(schema.defaultValue()); schemaObject.setDefault(schema.defaultValue()); } if (StringUtils.isNotBlank(schema.example())) { diff --git a/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/AllofResolvingTest.java b/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/AllofResolvingTest.java index e4a552dcee..527e74fdf1 100644 --- a/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/AllofResolvingTest.java +++ b/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/AllofResolvingTest.java @@ -29,18 +29,21 @@ public void testAllofResolving() { " - type: object\n" + " description: First user schema property\n" + " nullable: true\n" + + " default: \"\"\n" + " - $ref: \"#/components/schemas/UserProperty\"\n" + " propertyTwo:\n" + " allOf:\n" + " - type: object\n" + " description: Second user schema property\n" + " example: example value for propertyTwo\n" + + " default: \"\"\n" + " - $ref: \"#/components/schemas/UserProperty\"\n" + " propertyThree:\n" + " allOf:\n" + " - type: object\n" + " description: \"Third user schema property, with example for testing\"\n" + " example: example value for propertyThree\n" + + " default: \"\"\n"+ " - $ref: \"#/components/schemas/UserProperty\"\n"; SerializationMatchers.assertEqualsToYaml(c.getDefinedModels(), expectedYaml); @@ -64,12 +67,14 @@ public void testAllofResolving() { " - type: object\n" + " description: First order schema property\n" + " nullable: true\n" + + " default: \"\"\n" + " - $ref: \"#/components/schemas/OrderProperty\"\n" + " userProperty:\n" + " allOf:\n" + " - type: object\n" + " description: \"Order schema property, references UserProperty\"\n" + " example: example value for userProperty\n" + + " default: \"\"\n" + " - $ref: \"#/components/schemas/UserProperty\"\n" + "UserProperty:\n" + " type: object\n" + @@ -83,18 +88,21 @@ public void testAllofResolving() { " - type: object\n" + " description: First user schema property\n" + " nullable: true\n" + + " default: \"\"\n" + " - $ref: \"#/components/schemas/UserProperty\"\n" + " propertyTwo:\n" + " allOf:\n" + " - type: object\n" + " description: Second user schema property\n" + " example: example value for propertyTwo\n" + + " default: \"\"\n" + " - $ref: \"#/components/schemas/UserProperty\"\n" + " propertyThree:\n" + " allOf:\n" + " - type: object\n" + " description: \"Third user schema property, with example for testing\"\n" + " example: example value for propertyThree\n" + + " default: \"\"\n" + " - $ref: \"#/components/schemas/UserProperty\"\n"; SerializationMatchers.assertEqualsToYaml(c.getDefinedModels(), expectedYaml); } diff --git a/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/InlineResolvingTest.java b/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/InlineResolvingTest.java index 42afe5c0f9..c7d5e99a70 100644 --- a/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/InlineResolvingTest.java +++ b/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/InlineResolvingTest.java @@ -25,10 +25,12 @@ public void testInlineResolving() { " description: InlineSchemaFirst property 1\n" + " nullable: true\n" + " example: example\n" + + " default: \"\"\n" + " property2:\n" + " type: object\n" + " description: ' InlineSchemaFirst property 2'\n" + " example: example 2\n" + + " default: \"\"\n" + "InlineSchemaPropertyFirst:\n" + " type: object\n" + " description: property\n" + @@ -45,10 +47,12 @@ public void testInlineResolving() { " description: InlineSchemaFirst property 1\n" + " nullable: true\n" + " example: example\n" + + " default: \"\"\n" + " property2:\n" + " type: object\n" + " description: ' InlineSchemaFirst property 2'\n" + " example: example 2\n" + + " default: \"\"\n" + "InlineSchemaPropertyFirst:\n" + " type: object\n" + " description: property\n" + @@ -62,10 +66,12 @@ public void testInlineResolving() { " property1:\n" + " type: object\n" + " description: property 1\n" + + " default: \"\"\n" + " property2:\n" + " type: object\n" + " description: property 2\n" + " example: example\n" + + " default: \"\"\n" + " description: propertysecond\n" + " nullable: true\n" + " example: examplesecond\n" + @@ -85,27 +91,33 @@ public void testInlineResolving() { " property1:\n" + " type: object\n" + " description: property 1\n" + + " default: \"\"\n" + " property2:\n" + " type: object\n" + " description: property 2\n" + " example: example\n" + + " default: \"\"\n" + " description: InlineSchemaSecond property 1\n" + " nullable: true\n" + " example: examplesecond\n" + + " default: \"\"\n" + " property2:\n" + " type: object\n" + " description: InlineSchemaSecond property 2\n" + " example: InlineSchemaSecond example 2\n" + + " default: \"\"\n" + "InlineSchemaSimple:\n" + " type: object\n" + " properties:\n" + " property1:\n" + " type: object\n" + " description: property 1\n" + + " default: \"\"\n" + " property2:\n" + " type: object\n" + " description: property 2\n" + - " example: example\n"; + " example: example\n" + + " default: \"\"\n"; SerializationMatchers.assertEqualsToYaml(c.getDefinedModels(), expectedYaml); } diff --git a/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/Ticket4679Test.java b/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/Ticket4679Test.java index 8c51838b3a..e5278452dc 100644 --- a/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/Ticket4679Test.java +++ b/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/Ticket4679Test.java @@ -20,8 +20,10 @@ public void testCustomSchemaImplementation() { " exampleField:\n" + " type: integer\n" + " format: int32\n" + + " default: \"\"\n" + " secondExampleField:\n" + - " type: string\n"; + " type: string\n" + + " default: \"\"\n"; Map stringSchemaMap = ModelConverters.getInstance(true).readAll(ModelWithCustomSchemaImplementationInProperty.class); SerializationMatchers.assertEqualsToYaml31(stringSchemaMap, expectedYaml); diff --git a/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/Ticket4800Test.java b/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/Ticket4800Test.java index a2475a1318..faa0ffe644 100644 --- a/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/Ticket4800Test.java +++ b/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/Ticket4800Test.java @@ -21,6 +21,7 @@ public void testCustomSchemaImplementation() { " description: Prop description\n" + " secondExampleFieldWithTypeProp:\n" + " type: string\n" + + " default: \"\"\n" + "MyEnum:\n" + " type: string\n" + " enum:\n" + diff --git a/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/v31/ModelResolverOAS31Test.java b/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/v31/ModelResolverOAS31Test.java index 512428ebb6..01f9244ba4 100644 --- a/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/v31/ModelResolverOAS31Test.java +++ b/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/v31/ModelResolverOAS31Test.java @@ -72,6 +72,7 @@ public void testOAS31Fields() { " country:\n" + " type: string\n" + " const: United States\n" + + " default: \"\"\n" + "Client:\n" + " type: object\n" + " properties:\n" + @@ -89,6 +90,7 @@ public void testOAS31Fields() { " type: array\n" + " items:\n" + " type: string\n" + + " default: \"\"\n" + " description: accepting country\n" + " enum:\n" + " - UNITED_STATES_OF_AMERICA\n" + @@ -98,6 +100,7 @@ public void testOAS31Fields() { " type: array\n" + " items:\n" + " $ref: \"#/components/schemas/Currency\"\n" + + " default: \"\"\n" + " description: available currencies\n" + " uniqueItems: true\n" + "Currency:\n" + @@ -115,38 +118,46 @@ public void testOAS31Fields() { " type: array\n" + " contains:\n" + " type: string\n" + + " default: \"\"\n" + " items:\n" + " type: string\n" + " maxContains: 10\n" + " minContains: 1\n" + " prefixItems:\n" + " - type: string\n" + + " default: \"\"\n" + " unevaluatedItems:\n" + " type: number\n" + + " default: \"\"\n" + " status:\n" + " type:\n" + " - string\n" + " - number\n" + + " default: \"\"\n" + " intValue:\n" + " type: integer\n" + " format: int32\n" + " $anchor: intValue\n" + " $comment: comment at schema property level\n" + + " default: \"\"\n" + " exclusiveMaximum: 100\n" + " exclusiveMinimum: 1\n" + " text:\n" + " type: string\n" + " contentEncoding: plan/text\n" + " contentMediaType: base64\n" + + " default: \"\"\n" + " encodedString:\n" + " type: string\n" + " contentMediaType: application/jwt\n" + " contentSchema:\n" + " $ref: \"#/components/schemas/MultipleBaseBean\"\n" + + " default: \"\"\n" + " address:\n" + " $ref: \"#/components/schemas/Address\"\n" + " client:\n" + " $ref: \"#/components/schemas/Client\"\n" + + " default: \"\"\n" + " dependentSchemas:\n" + " creditCard:\n" + " $ref: \"#/components/schemas/CreditCard\"\n" + @@ -189,12 +200,14 @@ public void testOAS31Fields() { " properties:\n" + " postalCode:\n" + " type: string\n" + + " default: \"\"\n" + " pattern: \"[0-9]{5}(-[0-9]{4})?\"\n" + "PostalCodePattern:\n" + " type: object\n" + " properties:\n" + " postalCode:\n" + " type: string\n" + + " default: \"\"\n" + " pattern: \"[A-Z][0-9][A-Z] [0-9][A-Z][0-9]\"\n" + "PropertyNamesPattern:\n" + " pattern: \"^[A-Za-z_][A-Za-z0-9_]*$\"\n"); @@ -216,6 +229,7 @@ public void testDependentSchemasAnnotation() { " type: object\n" + " dependentSchemas:\n" + " value:\n" + + " default: \"\"\n" + " properties:\n" + " enable:\n" + " $ref: \"#/components/schemas/BooleanFakeClass\"\n" + diff --git a/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/v31/Ticket3900Test.java b/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/v31/Ticket3900Test.java index 5943bf949c..69ccad6ec5 100644 --- a/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/v31/Ticket3900Test.java +++ b/modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/v31/Ticket3900Test.java @@ -18,12 +18,15 @@ public void testArraySchemaItemsValidation() { "properties:\n" + " startPoint:\n" + " $ref: '#/components/schemas/GeoPoint'\n" + + " default: \"\"\n" + " description: Point where the route begins\n" + " intermediatePoint:\n" + " $ref: '#/components/schemas/GeoPoint'\n" + + " default: \"\"\n" + " description: Intermediate point of the route\n" + " endPoint:\n" + " $ref: '#/components/schemas/GeoPoint'\n" + + " default: \"\"\n" + " description: Point where the route ends"); } diff --git a/modules/swagger-core/src/test/java/io/swagger/v3/core/util/AnnotationsUtilsTest.java b/modules/swagger-core/src/test/java/io/swagger/v3/core/util/AnnotationsUtilsTest.java index 3b717062fc..55bfc86da5 100644 --- a/modules/swagger-core/src/test/java/io/swagger/v3/core/util/AnnotationsUtilsTest.java +++ b/modules/swagger-core/src/test/java/io/swagger/v3/core/util/AnnotationsUtilsTest.java @@ -21,6 +21,7 @@ import java.util.UUID; import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; public class AnnotationsUtilsTest { @@ -65,7 +66,8 @@ private Object[][] expectedSchemaFromTypeAndFormat() { {"byteType", ImmutableMap.of("type", "string", "format", "byte")}, {"binaryType", ImmutableMap.of("type", "string", "format", "binary")}, {"emailType", ImmutableMap.of("type", "string", "format", "email")}, - {"dummyType", ImmutableMap.of("$ref", "#/components/schemas/DummyClass")} + {"dummyType", ImmutableMap.of("$ref", "#/components/schemas/DummyClass")}, + {"emptyDefaultValue", ImmutableMap.of("type", "string", "defaultValue", "")} }; } @@ -79,6 +81,11 @@ public void getSchema(String methodName, Map expected) throws No assertEquals(schema.get().getType(), expected.get("type")); assertEquals(schema.get().getFormat(), expected.get("format")); assertEquals(schema.get().get$ref(), expected.get("$ref")); + + if (expected.containsKey("defaultValue")) { + assertNotNull(schema.get().getDefault()); + assertEquals(schema.get().getDefault(), expected.get("defaultValue")); + } } @ApiResponse(content = @Content(schema = @io.swagger.v3.oas.annotations.media.Schema(implementation = Byte.class))) @@ -97,6 +104,9 @@ private void emailType() { private void dummyType() { } - class DummyClass implements Serializable {} + @ApiResponse(content = @Content(schema = @io.swagger.v3.oas.annotations.media.Schema(defaultValue = "", type = "string"))) + private void emptyDefaultValue() { + } + class DummyClass implements Serializable {} } diff --git a/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/SchemaResolutionAllOfTest.java b/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/SchemaResolutionAllOfTest.java index f64aafc2ac..33f4f89a75 100644 --- a/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/SchemaResolutionAllOfTest.java +++ b/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/SchemaResolutionAllOfTest.java @@ -34,6 +34,7 @@ public void testSchemaResolutionAllOf() { " schema:\n" + " allOf:\n" + " - description: InlineSchemaSecond API\n" + + " default: \"\"\n" + " - $ref: \"#/components/schemas/InlineSchemaFirst\"\n" + " responses:\n" + " default:\n" + diff --git a/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/SchemaResolutionAnnotationTest.java b/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/SchemaResolutionAnnotationTest.java index 57be1ac7f9..0bbafee6c2 100644 --- a/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/SchemaResolutionAnnotationTest.java +++ b/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/SchemaResolutionAnnotationTest.java @@ -59,6 +59,7 @@ public void testSchemaResolutionAnnotation() { " nullable: true\n" + " allOf:\n" + " - $ref: \"#/components/schemas/InlineSchemaPropertyFirst\"\n" + + " default: \"\"\n" + " property2:\n" + " type: object\n" + " properties:\n" + @@ -110,7 +111,8 @@ public void testSchemaResolutionAnnotation() { " description: property 2\n" + " example: example\n" + " allOf:\n" + - " - $ref: \"#/components/schemas/InlineSchemaPropertySimple\"\n"; + " - $ref: \"#/components/schemas/InlineSchemaPropertySimple\"\n" + + " default: \"\"\n"; SerializationMatchers.assertEqualsToYaml(openAPI, yaml); ModelConverters.reset(); } diff --git a/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/annotations/callbacks/CallbackTest.java b/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/annotations/callbacks/CallbackTest.java index a8229bfeda..31e6f63f4d 100644 --- a/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/annotations/callbacks/CallbackTest.java +++ b/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/annotations/callbacks/CallbackTest.java @@ -212,7 +212,8 @@ public void simpleCallbacksWithOneCallbackWithOperationTest() { " application/json:\n" + " schema:\n" + " type: integer\n" + - " format: int32"; + " format: int32\n" + + " default: \"\""; String extractedYAML = openApiYAML.substring(start, end); assertEquals(expectedYAML, extractedYAML); @@ -276,6 +277,7 @@ public void simpleCallbacksWithMultipleCallbackWithOperationTest() { " schema:\n" + " type: integer\n" + " format: int32\n" + + " default: \"\"\n" + " testCallback2:\n" + " http://$request.query.url: {}"; String extractedYAML = openApiYAML.substring(start, end); @@ -344,6 +346,7 @@ public void callbackCallbacksAnnotationTest() { " schema:\n" + " type: integer\n" + " format: int32\n" + + " default: \"\"\n" + " testCallback2:\n" + " http://$request.query.url: {}"; String extractedYAML = openApiYAML.substring(start, end); @@ -379,6 +382,7 @@ public void repeatableCallbackCallbacksAnnotationTest() { " schema:\n" + " type: integer\n" + " format: int32\n" + + " default: \"\"\n" + " testCallback2:\n" + " http://$request.query.url: {}"; String extractedYAML = openApiYAML.substring(start, end); diff --git a/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/annotations/encoding/EncodingTest.java b/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/annotations/encoding/EncodingTest.java index da96efbc6a..c53975b16a 100644 --- a/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/annotations/encoding/EncodingTest.java +++ b/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/annotations/encoding/EncodingTest.java @@ -37,6 +37,7 @@ public void testSimpleGetOperationWithEncodingInApiResponse() { " application/json:\n" + " schema:\n" + " type: string\n" + + " default: \"\"\n" + " encoding:\n" + " test:\n" + " contentType: text/plain\n" + @@ -247,6 +248,7 @@ public void testGetOperationWithEncodingInRequestBody() { " application/json:\n" + " schema:\n" + " type: string\n" + + " default: \"\"\n" + " encoding:\n" + " testRequestBody:\n" + " contentType: text/plain\n" + diff --git a/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/annotations/requests/RequestBodyTest.java b/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/annotations/requests/RequestBodyTest.java index 5b8c544bf0..b69d0efffd 100644 --- a/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/annotations/requests/RequestBodyTest.java +++ b/modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/annotations/requests/RequestBodyTest.java @@ -454,6 +454,7 @@ public void testFileUploadOctetStream() throws IOException { " schema:\n" + " type: string\n" + " format: binary\n" + + " default: \"\"\n" + " responses:\n" + " default:\n" + " description: default response\n" + diff --git a/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/ComplexCallback31Resource.yaml b/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/ComplexCallback31Resource.yaml index 79189d9464..2f7440de72 100644 --- a/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/ComplexCallback31Resource.yaml +++ b/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/ComplexCallback31Resource.yaml @@ -31,6 +31,7 @@ paths: format: int32 $comment: random comment $id: http://yourdomain.com/schemas/myschema.json + default: "" dependentSchemas: pet: { } patternProperties: @@ -47,6 +48,7 @@ paths: application/json: schema: $ref: "#/components/schemas/User" + defalut: "" components: schemas: User: @@ -70,6 +72,7 @@ components: userStatus: type: integer format: int32 + default: "" description: User Status xml: name: User diff --git a/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/ComplexCallbackResource.yaml b/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/ComplexCallbackResource.yaml index 4e9c0a64c5..ca8a86c71f 100644 --- a/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/ComplexCallbackResource.yaml +++ b/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/ComplexCallbackResource.yaml @@ -27,6 +27,7 @@ paths: schema: type: integer format: int32 + default: "" testCallback2: http://www.url2.com: get: diff --git a/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/MultipleCallbacksTestWithOperationResource.yaml b/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/MultipleCallbacksTestWithOperationResource.yaml index 6bdb5cd369..9baaa743e6 100644 --- a/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/MultipleCallbacksTestWithOperationResource.yaml +++ b/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/MultipleCallbacksTestWithOperationResource.yaml @@ -21,5 +21,6 @@ paths: schema: type: integer format: int32 + default: "" testCallback2: http://$request.query.url: {} diff --git a/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/RepeatableCallbackResource.yaml b/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/RepeatableCallbackResource.yaml index bed776dee4..71a915599c 100644 --- a/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/RepeatableCallbackResource.yaml +++ b/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/RepeatableCallbackResource.yaml @@ -23,5 +23,6 @@ paths: schema: type: integer format: int32 + default: "" testCallback2: http://$request.query.url: {} diff --git a/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/SimpleCallbackWithOperationResource.yaml b/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/SimpleCallbackWithOperationResource.yaml index 1a1be9ea79..c9d1c655e1 100644 --- a/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/SimpleCallbackWithOperationResource.yaml +++ b/modules/swagger-jaxrs2/src/test/resources/petstore/callbacks/SimpleCallbackWithOperationResource.yaml @@ -21,3 +21,4 @@ paths: schema: type: integer format: int32 + default: "" diff --git a/modules/swagger-jaxrs2/src/test/resources/petstore/example/ExamplesResource.yaml b/modules/swagger-jaxrs2/src/test/resources/petstore/example/ExamplesResource.yaml index 4e9c8aad3f..4ace082a90 100644 --- a/modules/swagger-jaxrs2/src/test/resources/petstore/example/ExamplesResource.yaml +++ b/modules/swagger-jaxrs2/src/test/resources/petstore/example/ExamplesResource.yaml @@ -14,16 +14,16 @@ paths: description: Schema example: Subscription example examples: - subscriptionId_2: - summary: Subscription number 54321 - description: subscriptionId_2 - value: 54321 - externalValue: Subscription external value 2 subscriptionId_1: summary: Subscription number 12345 description: subscriptionId_1 value: 12345 externalValue: Subscription external value 1 + subscriptionId_2: + summary: Subscription number 54321 + description: subscriptionId_2 + value: 54321 + externalValue: Subscription external value 2 example: example requestBody: description: Created user object @@ -35,6 +35,7 @@ paths: format: uuid readOnly: true example: Schema example + default: "" examples: Default Request: summary: Subscription Request Example @@ -53,6 +54,7 @@ paths: format: uuid readOnly: true example: Schema example + default: "" examples: Default Response: summary: Subscription Response Example @@ -61,6 +63,11 @@ paths: externalValue: Subscription Response value 1 components: schemas: + SubscriptionResponse: + type: object + properties: + subscriptionId: + type: string User: type: object properties: @@ -85,8 +92,3 @@ components: format: int32 xml: name: User - SubscriptionResponse: - type: object - properties: - subscriptionId: - type: string diff --git a/modules/swagger-jaxrs2/src/test/resources/petstore/links/LinksAndContent31Resource.yaml b/modules/swagger-jaxrs2/src/test/resources/petstore/links/LinksAndContent31Resource.yaml index b513fbc412..cf547aaf10 100644 --- a/modules/swagger-jaxrs2/src/test/resources/petstore/links/LinksAndContent31Resource.yaml +++ b/modules/swagger-jaxrs2/src/test/resources/petstore/links/LinksAndContent31Resource.yaml @@ -15,6 +15,7 @@ paths: '*/*': schema: type: object + default: "" dependentSchemas: value: type: