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 61
61
<maven-gpg-plugin .version>1.6</maven-gpg-plugin .version>
62
62
<maven-release-plugin .version>2.5.3</maven-release-plugin .version>
63
63
<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>
65
65
<swagger-ui .version>4.10.3</swagger-ui .version>
66
66
<classgraph .version>4.8.143</classgraph .version>
67
67
<webjars-locator-core .version>0.50</webjars-locator-core .version>
Original file line number Diff line number Diff line change 31
31
import io .swagger .v3 .core .filter .SpecFilter ;
32
32
import io .swagger .v3 .core .jackson .ApiResponsesSerializer ;
33
33
import io .swagger .v3 .core .jackson .PathsSerializer ;
34
+ import io .swagger .v3 .core .jackson .mixin .Components31Mixin ;
34
35
import io .swagger .v3 .core .jackson .mixin .ComponentsMixin ;
35
36
import io .swagger .v3 .core .jackson .mixin .DateSchemaMixin ;
37
+ import io .swagger .v3 .core .jackson .mixin .Discriminator31Mixin ;
36
38
import io .swagger .v3 .core .jackson .mixin .ExampleMixin ;
37
39
import io .swagger .v3 .core .jackson .mixin .ExtensionsMixin ;
38
40
import io .swagger .v3 .core .jackson .mixin .MediaTypeMixin ;
41
+ import io .swagger .v3 .core .jackson .mixin .OpenAPI31Mixin ;
39
42
import io .swagger .v3 .core .jackson .mixin .OpenAPIMixin ;
40
43
import io .swagger .v3 .core .jackson .mixin .OperationMixin ;
44
+ import io .swagger .v3 .core .jackson .mixin .Schema31Mixin ;
41
45
import io .swagger .v3 .core .jackson .mixin .SchemaMixin ;
42
46
import io .swagger .v3 .oas .annotations .ExternalDocumentation ;
43
47
import io .swagger .v3 .oas .annotations .Hidden ;
232
236
OpenAPIMixin .class ,
233
237
OperationMixin .class ,
234
238
SchemaMixin .class ,
239
+ Schema31Mixin .class ,
240
+ Components31Mixin .class ,
241
+ OpenAPI31Mixin .class ,
242
+ Discriminator31Mixin .class ,
235
243
Paths .class ,
236
244
XML .class ,
237
245
UUIDSchema .class ,
Original file line number Diff line number Diff line change @@ -371,6 +371,11 @@ public Class<?>[] subTypes() {
371
371
public Extension [] extensions () {
372
372
return parameter .schema ().extensions ();
373
373
}
374
+
375
+ @ Override
376
+ public AdditionalPropertiesValue additionalProperties () {
377
+ return parameter .schema ().additionalProperties ();
378
+ }
374
379
};
375
380
}
376
381
@@ -587,6 +592,11 @@ public Class<?>[] subTypes() {
587
592
public Extension [] extensions () {
588
593
return schema .extensions ();
589
594
}
595
+
596
+ @ Override
597
+ public AdditionalPropertiesValue additionalProperties () {
598
+ return schema .additionalProperties ();
599
+ }
590
600
};
591
601
}
592
602
Original file line number Diff line number Diff line change @@ -80,6 +80,10 @@ public class Builder {
80
80
*/
81
81
private String ref = "" ;
82
82
83
+ /**
84
+ * The Use return type schema.
85
+ */
86
+ boolean useReturnTypeSchema = false ;
83
87
84
88
/**
85
89
* Instantiates a new Api response builder.
@@ -241,6 +245,11 @@ public Extension[] extensions() {
241
245
public String ref () {
242
246
return ref ;
243
247
}
248
+
249
+ @ Override
250
+ public boolean useReturnTypeSchema () {
251
+ return useReturnTypeSchema ;
252
+ }
244
253
};
245
254
}
246
255
}
Original file line number Diff line number Diff line change 30
30
import io .swagger .v3 .oas .annotations .media .Encoding ;
31
31
import io .swagger .v3 .oas .annotations .media .ExampleObject ;
32
32
import io .swagger .v3 .oas .annotations .media .Schema ;
33
+ import io .swagger .v3 .oas .annotations .media .SchemaProperty ;
33
34
import org .apache .commons .lang3 .ArrayUtils ;
34
35
35
36
/**
@@ -75,6 +76,17 @@ public class Builder {
75
76
*/
76
77
private Extension [] extensions = {};
77
78
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 = {};
78
90
79
91
/**
80
92
* Instantiates a new Content builder.
@@ -185,6 +197,16 @@ public Schema schema() {
185
197
return schema ;
186
198
}
187
199
200
+ @ Override
201
+ public SchemaProperty [] schemaProperties () {
202
+ return schemaProperties ;
203
+ }
204
+
205
+ @ Override
206
+ public Schema additionalPropertiesSchema () {
207
+ return additionalPropertiesSchema ;
208
+ }
209
+
188
210
@ Override
189
211
public ArraySchema array () {
190
212
return array ;
Original file line number Diff line number Diff line change 29
29
import io .swagger .v3 .oas .annotations .media .DiscriminatorMapping ;
30
30
import io .swagger .v3 .oas .annotations .media .Schema ;
31
31
import io .swagger .v3 .oas .annotations .media .Schema .AccessMode ;
32
+ import io .swagger .v3 .oas .annotations .media .Schema .AdditionalPropertiesValue ;
32
33
import org .apache .commons .lang3 .ArrayUtils ;
33
34
34
35
/**
@@ -259,6 +260,16 @@ public class Builder {
259
260
*/
260
261
private Extension [] extensions = {};
261
262
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
+
262
273
263
274
/**
264
275
* Instantiates a new Schema builder.
@@ -872,6 +883,11 @@ public Class<?>[] subTypes() {
872
883
public Extension [] extensions () {
873
884
return extensions ;
874
885
}
886
+
887
+ @ Override
888
+ public AdditionalPropertiesValue additionalProperties () {
889
+ return additionalProperties ;
890
+ }
875
891
};
876
892
}
877
893
}
Original file line number Diff line number Diff line change 22
22
23
23
package org .springdoc .core .mixins ;
24
24
25
+ import java .math .BigDecimal ;
25
26
import java .util .Map ;
27
+ import java .util .Set ;
26
28
27
29
import com .fasterxml .jackson .annotation .JsonAnyGetter ;
28
30
import com .fasterxml .jackson .annotation .JsonAnySetter ;
29
31
import com .fasterxml .jackson .annotation .JsonIgnore ;
30
32
import com .fasterxml .jackson .annotation .JsonInclude ;
31
33
import com .fasterxml .jackson .annotation .JsonPropertyOrder ;
34
+ import io .swagger .v3 .oas .models .media .Schema ;
32
35
33
36
/**
34
37
* @author bnasslashen
35
38
*/
36
- @ JsonPropertyOrder (value = {"type" , "format" }, alphabetic = true )
39
+ @ JsonPropertyOrder (value = { "type" , "format" }, alphabetic = true )
37
40
public interface SortedSchemaMixin {
38
41
39
42
@ JsonAnyGetter
@@ -49,4 +52,34 @@ public interface SortedSchemaMixin {
49
52
@ JsonInclude (JsonInclude .Include .CUSTOM )
50
53
Object getExample ();
51
54
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
+
52
85
}
You can’t perform that action at this time.
0 commit comments