File tree Expand file tree Collapse file tree 9 files changed +302
-204
lines changed
springdoc-openapi-starter-common/src/main/java/org/springdoc/core
springdoc-openapi-starter-webmvc-api/src/test/resources/results
springdoc-openapi-tests/springdoc-openapi-javadoc-tests/src/test/resources/results Expand file tree Collapse file tree 9 files changed +302
-204
lines changed Original file line number Diff line number Diff line change 6161 <maven-gpg-plugin .version>1.6</maven-gpg-plugin .version>
6262 <maven-release-plugin .version>2.5.3</maven-release-plugin .version>
6363 <nexus-staging-maven-plugin >1.6.8</nexus-staging-maven-plugin >
64- <swagger-api .version>2.1.13 </swagger-api .version>
64+ <swagger-api .version>2.2.0 </swagger-api .version>
6565 <swagger-ui .version>4.10.3</swagger-ui .version>
6666 <classgraph .version>4.8.143</classgraph .version>
6767 <webjars-locator-core .version>0.50</webjars-locator-core .version>
Original file line number Diff line number Diff line change 3131import io .swagger .v3 .core .filter .SpecFilter ;
3232import io .swagger .v3 .core .jackson .ApiResponsesSerializer ;
3333import io .swagger .v3 .core .jackson .PathsSerializer ;
34+ import io .swagger .v3 .core .jackson .mixin .Components31Mixin ;
3435import io .swagger .v3 .core .jackson .mixin .ComponentsMixin ;
3536import io .swagger .v3 .core .jackson .mixin .DateSchemaMixin ;
37+ import io .swagger .v3 .core .jackson .mixin .Discriminator31Mixin ;
3638import io .swagger .v3 .core .jackson .mixin .ExampleMixin ;
3739import io .swagger .v3 .core .jackson .mixin .ExtensionsMixin ;
3840import io .swagger .v3 .core .jackson .mixin .MediaTypeMixin ;
41+ import io .swagger .v3 .core .jackson .mixin .OpenAPI31Mixin ;
3942import io .swagger .v3 .core .jackson .mixin .OpenAPIMixin ;
4043import io .swagger .v3 .core .jackson .mixin .OperationMixin ;
44+ import io .swagger .v3 .core .jackson .mixin .Schema31Mixin ;
4145import io .swagger .v3 .core .jackson .mixin .SchemaMixin ;
4246import io .swagger .v3 .oas .annotations .ExternalDocumentation ;
4347import io .swagger .v3 .oas .annotations .Hidden ;
232236 OpenAPIMixin .class ,
233237 OperationMixin .class ,
234238 SchemaMixin .class ,
239+ Schema31Mixin .class ,
240+ Components31Mixin .class ,
241+ OpenAPI31Mixin .class ,
242+ Discriminator31Mixin .class ,
235243 Paths .class ,
236244 XML .class ,
237245 UUIDSchema .class ,
Original file line number Diff line number Diff line change @@ -371,6 +371,11 @@ public Class<?>[] subTypes() {
371371 public Extension [] extensions () {
372372 return parameter .schema ().extensions ();
373373 }
374+
375+ @ Override
376+ public AdditionalPropertiesValue additionalProperties () {
377+ return parameter .schema ().additionalProperties ();
378+ }
374379 };
375380 }
376381
@@ -587,6 +592,11 @@ public Class<?>[] subTypes() {
587592 public Extension [] extensions () {
588593 return schema .extensions ();
589594 }
595+
596+ @ Override
597+ public AdditionalPropertiesValue additionalProperties () {
598+ return schema .additionalProperties ();
599+ }
590600 };
591601 }
592602
Original file line number Diff line number Diff line change @@ -80,6 +80,10 @@ public class Builder {
8080 */
8181 private String ref = "" ;
8282
83+ /**
84+ * The Use return type schema.
85+ */
86+ boolean useReturnTypeSchema = false ;
8387
8488 /**
8589 * Instantiates a new Api response builder.
@@ -241,6 +245,11 @@ public Extension[] extensions() {
241245 public String ref () {
242246 return ref ;
243247 }
248+
249+ @ Override
250+ public boolean useReturnTypeSchema () {
251+ return useReturnTypeSchema ;
252+ }
244253 };
245254 }
246255}
Original file line number Diff line number Diff line change 3030import io .swagger .v3 .oas .annotations .media .Encoding ;
3131import io .swagger .v3 .oas .annotations .media .ExampleObject ;
3232import io .swagger .v3 .oas .annotations .media .Schema ;
33+ import io .swagger .v3 .oas .annotations .media .SchemaProperty ;
3334import org .apache .commons .lang3 .ArrayUtils ;
3435
3536/**
@@ -75,6 +76,17 @@ public class Builder {
7576 */
7677 private Extension [] extensions = {};
7778
79+ /**
80+ * The schema properties defined for schema provided in @Schema
81+ *
82+ */
83+ private Schema additionalPropertiesSchema = org .springdoc .core .fn .builders .schema .Builder .schemaBuilder ().build ();
84+
85+ /**
86+ * The schema properties defined for schema provided in @Schema
87+ *
88+ */
89+ private SchemaProperty [] schemaProperties = {};
7890
7991 /**
8092 * Instantiates a new Content builder.
@@ -185,6 +197,16 @@ public Schema schema() {
185197 return schema ;
186198 }
187199
200+ @ Override
201+ public SchemaProperty [] schemaProperties () {
202+ return schemaProperties ;
203+ }
204+
205+ @ Override
206+ public Schema additionalPropertiesSchema () {
207+ return additionalPropertiesSchema ;
208+ }
209+
188210 @ Override
189211 public ArraySchema array () {
190212 return array ;
Original file line number Diff line number Diff line change 2929import io .swagger .v3 .oas .annotations .media .DiscriminatorMapping ;
3030import io .swagger .v3 .oas .annotations .media .Schema ;
3131import io .swagger .v3 .oas .annotations .media .Schema .AccessMode ;
32+ import io .swagger .v3 .oas .annotations .media .Schema .AdditionalPropertiesValue ;
3233import org .apache .commons .lang3 .ArrayUtils ;
3334
3435/**
@@ -259,6 +260,16 @@ public class Builder {
259260 */
260261 private Extension [] extensions = {};
261262
263+ /**
264+ * Allows to specify the additionalProperties value
265+ *
266+ * AdditionalPropertiesValue.TRUE: set to TRUE
267+ * AdditionalPropertiesValue.FALSE: set to FALSE
268+ * AdditionalPropertiesValue.USE_ADDITIONAL_PROPERTIES_ANNOTATION: resolve from @Content.additionalPropertiesSchema
269+ *
270+ */
271+ private AdditionalPropertiesValue additionalProperties = AdditionalPropertiesValue .USE_ADDITIONAL_PROPERTIES_ANNOTATION ;
272+
262273
263274 /**
264275 * Instantiates a new Schema builder.
@@ -872,6 +883,11 @@ public Class<?>[] subTypes() {
872883 public Extension [] extensions () {
873884 return extensions ;
874885 }
886+
887+ @ Override
888+ public AdditionalPropertiesValue additionalProperties () {
889+ return additionalProperties ;
890+ }
875891 };
876892 }
877893}
Original file line number Diff line number Diff line change 2222
2323package org .springdoc .core .mixins ;
2424
25+ import java .math .BigDecimal ;
2526import java .util .Map ;
27+ import java .util .Set ;
2628
2729import com .fasterxml .jackson .annotation .JsonAnyGetter ;
2830import com .fasterxml .jackson .annotation .JsonAnySetter ;
2931import com .fasterxml .jackson .annotation .JsonIgnore ;
3032import com .fasterxml .jackson .annotation .JsonInclude ;
3133import com .fasterxml .jackson .annotation .JsonPropertyOrder ;
34+ import io .swagger .v3 .oas .models .media .Schema ;
3235
3336/**
3437 * @author bnasslashen
3538 */
36- @ JsonPropertyOrder (value = {"type" , "format" }, alphabetic = true )
39+ @ JsonPropertyOrder (value = { "type" , "format" }, alphabetic = true )
3740public interface SortedSchemaMixin {
3841
3942 @ JsonAnyGetter
@@ -49,4 +52,34 @@ public interface SortedSchemaMixin {
4952 @ JsonInclude (JsonInclude .Include .CUSTOM )
5053 Object getExample ();
5154
55+ @ JsonIgnore
56+ Map <String , Object > getJsonSchema ();
57+
58+ @ JsonIgnore
59+ BigDecimal getExclusiveMinimumValue ();
60+
61+ @ JsonIgnore
62+ BigDecimal getExclusiveMaximumValue ();
63+
64+ @ JsonIgnore
65+ Map <String , Schema > getPatternProperties ();
66+
67+ @ JsonIgnore
68+ Schema getContains ();
69+
70+ @ JsonIgnore
71+ String get$id ();
72+
73+ @ JsonIgnore
74+ String get$anchor ();
75+
76+ @ JsonIgnore
77+ String get$schema ();
78+
79+ @ JsonIgnore
80+ Set <String > getTypes ();
81+
82+ @ JsonIgnore
83+ Object getJsonSchemaImpl ();
84+
5285}
You can’t perform that action at this time.
0 commit comments