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 68
68
<maven-gpg-plugin .version>1.6</maven-gpg-plugin .version>
69
69
<maven-release-plugin .version>2.5.3</maven-release-plugin .version>
70
70
<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>
73
73
<spring-security-oauth2 .version>2.3.8.RELEASE</spring-security-oauth2 .version>
74
74
<classgraph .version>4.8.143</classgraph .version>
75
75
<webjars-locator-core .version>0.50</webjars-locator-core .version>
Original file line number Diff line number Diff line change 20
20
21
21
package org .springdoc .api .mixins ;
22
22
23
+ import java .math .BigDecimal ;
23
24
import java .util .Map ;
25
+ import java .util .Set ;
24
26
25
27
import com .fasterxml .jackson .annotation .JsonAnyGetter ;
26
28
import com .fasterxml .jackson .annotation .JsonAnySetter ;
27
29
import com .fasterxml .jackson .annotation .JsonIgnore ;
28
30
import com .fasterxml .jackson .annotation .JsonInclude ;
29
31
import com .fasterxml .jackson .annotation .JsonPropertyOrder ;
32
+ import io .swagger .v3 .oas .models .media .Schema ;
30
33
31
34
/**
32
35
* @author bnasslashen
33
36
*/
34
- @ JsonPropertyOrder (value = {"type" , "format" }, alphabetic = true )
37
+ @ JsonPropertyOrder (value = { "type" , "format" }, alphabetic = true )
35
38
public interface SortedSchemaMixin {
36
39
37
40
@ JsonAnyGetter
@@ -47,4 +50,34 @@ public interface SortedSchemaMixin {
47
50
@ JsonInclude (JsonInclude .Include .CUSTOM )
48
51
Object getExample ();
49
52
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() {
349
349
public Extension [] extensions () {
350
350
return parameter .schema ().extensions ();
351
351
}
352
+
353
+ @ Override
354
+ public AdditionalPropertiesValue additionalProperties () {
355
+ return parameter .schema ().additionalProperties ();
356
+ }
352
357
};
353
358
}
354
359
@@ -565,6 +570,11 @@ public Class<?>[] subTypes() {
565
570
public Extension [] extensions () {
566
571
return schema .extensions ();
567
572
}
573
+
574
+ @ Override
575
+ public AdditionalPropertiesValue additionalProperties () {
576
+ return schema .additionalProperties ();
577
+ }
568
578
};
569
579
}
570
580
Original file line number Diff line number Diff line change @@ -81,6 +81,10 @@ public class Builder {
81
81
*/
82
82
private String ref = "" ;
83
83
84
+ /**
85
+ * The Use return type schema.
86
+ */
87
+ boolean useReturnTypeSchema = false ;
84
88
85
89
/**
86
90
* Instantiates a new Api response builder.
@@ -242,6 +246,11 @@ public Extension[] extensions() {
242
246
public String ref () {
243
247
return ref ;
244
248
}
249
+
250
+ @ Override
251
+ public boolean useReturnTypeSchema () {
252
+ return useReturnTypeSchema ;
253
+ }
245
254
};
246
255
}
247
256
}
Original file line number Diff line number Diff line change 31
31
import io .swagger .v3 .oas .annotations .media .Encoding ;
32
32
import io .swagger .v3 .oas .annotations .media .ExampleObject ;
33
33
import io .swagger .v3 .oas .annotations .media .Schema ;
34
+ import io .swagger .v3 .oas .annotations .media .SchemaProperty ;
34
35
import org .apache .commons .lang3 .ArrayUtils ;
35
36
36
37
/**
@@ -77,6 +78,18 @@ public class Builder {
77
78
private Extension [] extensions = {};
78
79
79
80
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
+
80
93
/**
81
94
* Instantiates a new Content builder.
82
95
*/
@@ -186,6 +199,16 @@ public Schema schema() {
186
199
return schema ;
187
200
}
188
201
202
+ @ Override
203
+ public SchemaProperty [] schemaProperties () {
204
+ return schemaProperties ;
205
+ }
206
+
207
+ @ Override
208
+ public Schema additionalPropertiesSchema () {
209
+ return additionalPropertiesSchema ;
210
+ }
211
+
189
212
@ Override
190
213
public ArraySchema array () {
191
214
return array ;
Original file line number Diff line number Diff line change 30
30
import io .swagger .v3 .oas .annotations .media .DiscriminatorMapping ;
31
31
import io .swagger .v3 .oas .annotations .media .Schema ;
32
32
import io .swagger .v3 .oas .annotations .media .Schema .AccessMode ;
33
+ import io .swagger .v3 .oas .annotations .media .Schema .AdditionalPropertiesValue ;
33
34
import org .apache .commons .lang3 .ArrayUtils ;
34
35
35
36
/**
@@ -260,6 +261,15 @@ public class Builder {
260
261
*/
261
262
private Extension [] extensions = {};
262
263
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 ;
263
273
264
274
/**
265
275
* Instantiates a new Schema builder.
@@ -873,6 +883,11 @@ public Class<?>[] subTypes() {
873
883
public Extension [] extensions () {
874
884
return extensions ;
875
885
}
886
+
887
+ @ Override
888
+ public AdditionalPropertiesValue additionalProperties () {
889
+ return additionalProperties ;
890
+ }
876
891
};
877
892
}
878
893
}
You can’t perform that action at this time.
0 commit comments