File tree Expand file tree Collapse file tree 9 files changed +304
-206
lines changed
springdoc-openapi-common/src/main/java/org/springdoc
springdoc-openapi-javadoc/src/test/resources/results
springdoc-openapi-native/src/main/java/org/springdoc/nativex/core
springdoc-openapi-webmvc-core/src/test/resources/results Expand file tree Collapse file tree 9 files changed +304
-206
lines changed Original file line number Diff line number Diff line change 6868 <maven-gpg-plugin .version>1.6</maven-gpg-plugin .version>
6969 <maven-release-plugin .version>2.5.3</maven-release-plugin .version>
7070 <nexus-staging-maven-plugin >1.6.8</nexus-staging-maven-plugin >
71- <swagger-api .version>2.1.13 </swagger-api .version>
72- <swagger-ui .version>4.9.1 </swagger-ui .version>
71+ <swagger-api .version>2.2.0 </swagger-api .version>
72+ <swagger-ui .version>4.10.3 </swagger-ui .version>
7373 <spring-security-oauth2 .version>2.3.8.RELEASE</spring-security-oauth2 .version>
7474 <classgraph .version>4.8.143</classgraph .version>
7575 <webjars-locator-core .version>0.50</webjars-locator-core .version>
Original file line number Diff line number Diff line change 2020
2121package org .springdoc .api .mixins ;
2222
23+ import java .math .BigDecimal ;
2324import java .util .Map ;
25+ import java .util .Set ;
2426
2527import com .fasterxml .jackson .annotation .JsonAnyGetter ;
2628import com .fasterxml .jackson .annotation .JsonAnySetter ;
2729import com .fasterxml .jackson .annotation .JsonIgnore ;
2830import com .fasterxml .jackson .annotation .JsonInclude ;
2931import com .fasterxml .jackson .annotation .JsonPropertyOrder ;
32+ import io .swagger .v3 .oas .models .media .Schema ;
3033
3134/**
3235 * @author bnasslashen
3336 */
34- @ JsonPropertyOrder (value = {"type" , "format" }, alphabetic = true )
37+ @ JsonPropertyOrder (value = { "type" , "format" }, alphabetic = true )
3538public interface SortedSchemaMixin {
3639
3740 @ JsonAnyGetter
@@ -47,4 +50,34 @@ public interface SortedSchemaMixin {
4750 @ JsonInclude (JsonInclude .Include .CUSTOM )
4851 Object getExample ();
4952
50- }
53+ @ JsonIgnore
54+ Map <String , Object > getJsonSchema ();
55+
56+ @ JsonIgnore
57+ BigDecimal getExclusiveMinimumValue ();
58+
59+ @ JsonIgnore
60+ BigDecimal getExclusiveMaximumValue ();
61+
62+ @ JsonIgnore
63+ Map <String , Schema > getPatternProperties ();
64+
65+ @ JsonIgnore
66+ Schema getContains ();
67+
68+ @ JsonIgnore
69+ String get$id ();
70+
71+ @ JsonIgnore
72+ String get$anchor ();
73+
74+ @ JsonIgnore
75+ String get$schema ();
76+
77+ @ JsonIgnore
78+ Set <String > getTypes ();
79+
80+ @ JsonIgnore
81+ Object getJsonSchemaImpl ();
82+
83+ }
Original file line number Diff line number Diff line change @@ -349,6 +349,11 @@ public Class<?>[] subTypes() {
349349 public Extension [] extensions () {
350350 return parameter .schema ().extensions ();
351351 }
352+
353+ @ Override
354+ public AdditionalPropertiesValue additionalProperties () {
355+ return parameter .schema ().additionalProperties ();
356+ }
352357 };
353358 }
354359
@@ -565,6 +570,11 @@ public Class<?>[] subTypes() {
565570 public Extension [] extensions () {
566571 return schema .extensions ();
567572 }
573+
574+ @ Override
575+ public AdditionalPropertiesValue additionalProperties () {
576+ return schema .additionalProperties ();
577+ }
568578 };
569579 }
570580
Original file line number Diff line number Diff line change @@ -81,6 +81,10 @@ public class Builder {
8181 */
8282 private String ref = "" ;
8383
84+ /**
85+ * The Use return type schema.
86+ */
87+ boolean useReturnTypeSchema = false ;
8488
8589 /**
8690 * Instantiates a new Api response builder.
@@ -242,6 +246,11 @@ public Extension[] extensions() {
242246 public String ref () {
243247 return ref ;
244248 }
249+
250+ @ Override
251+ public boolean useReturnTypeSchema () {
252+ return useReturnTypeSchema ;
253+ }
245254 };
246255 }
247256}
Original file line number Diff line number Diff line change 3131import io .swagger .v3 .oas .annotations .media .Encoding ;
3232import io .swagger .v3 .oas .annotations .media .ExampleObject ;
3333import io .swagger .v3 .oas .annotations .media .Schema ;
34+ import io .swagger .v3 .oas .annotations .media .SchemaProperty ;
3435import org .apache .commons .lang3 .ArrayUtils ;
3536
3637/**
@@ -77,6 +78,18 @@ public class Builder {
7778 private Extension [] extensions = {};
7879
7980
81+ /**
82+ * The schema properties defined for schema provided in @Schema
83+ *
84+ */
85+ private Schema additionalPropertiesSchema = org .springdoc .core .fn .builders .schema .Builder .schemaBuilder ().build ();
86+
87+ /**
88+ * The schema properties defined for schema provided in @Schema
89+ *
90+ */
91+ private SchemaProperty [] schemaProperties = {};
92+
8093 /**
8194 * Instantiates a new Content builder.
8295 */
@@ -186,6 +199,16 @@ public Schema schema() {
186199 return schema ;
187200 }
188201
202+ @ Override
203+ public SchemaProperty [] schemaProperties () {
204+ return schemaProperties ;
205+ }
206+
207+ @ Override
208+ public Schema additionalPropertiesSchema () {
209+ return additionalPropertiesSchema ;
210+ }
211+
189212 @ Override
190213 public ArraySchema array () {
191214 return array ;
Original file line number Diff line number Diff line change 3030import io .swagger .v3 .oas .annotations .media .DiscriminatorMapping ;
3131import io .swagger .v3 .oas .annotations .media .Schema ;
3232import io .swagger .v3 .oas .annotations .media .Schema .AccessMode ;
33+ import io .swagger .v3 .oas .annotations .media .Schema .AdditionalPropertiesValue ;
3334import org .apache .commons .lang3 .ArrayUtils ;
3435
3536/**
@@ -260,6 +261,15 @@ public class Builder {
260261 */
261262 private Extension [] extensions = {};
262263
264+ /**
265+ * Allows to specify the additionalProperties value
266+ *
267+ * AdditionalPropertiesValue.TRUE: set to TRUE
268+ * AdditionalPropertiesValue.FALSE: set to FALSE
269+ * AdditionalPropertiesValue.USE_ADDITIONAL_PROPERTIES_ANNOTATION: resolve from @Content.additionalPropertiesSchema
270+ *
271+ */
272+ private AdditionalPropertiesValue additionalProperties = AdditionalPropertiesValue .USE_ADDITIONAL_PROPERTIES_ANNOTATION ;
263273
264274 /**
265275 * Instantiates a new Schema builder.
@@ -873,6 +883,11 @@ public Class<?>[] subTypes() {
873883 public Extension [] extensions () {
874884 return extensions ;
875885 }
886+
887+ @ Override
888+ public AdditionalPropertiesValue additionalProperties () {
889+ return additionalProperties ;
890+ }
876891 };
877892 }
878893}
You can’t perform that action at this time.
0 commit comments