Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<central-publishing-maven-plugin.version>0.7.0
</central-publishing-maven-plugin.version>
<flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version>
<swagger-api.version>2.2.36</swagger-api.version>
<swagger-api.version>2.2.38</swagger-api.version>
<swagger-ui.version>5.28.1</swagger-ui.version>
<gmavenplus-plugin.version>1.13.1</gmavenplus-plugin.version>
<jjwt.version>0.9.1</jjwt.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

public class MyModel {

@Schema(description = "Hello", type = "object", oneOf = { Foo.class, Bar.class })
@Schema(description = "Hello", types = "object", oneOf = { Foo.class, Bar.class })
private Object thing;

public Object getThing() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class TrackerData {
@JsonProperty("timestamp")
Instant timestamp;

@Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0")
@Schema(name = "value", types = "number", format = "double", description = "The data value", required = true, example = "19.0")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If type = "number" is provided, then the schema type is incorrectly assigned as string.
If the type is omitted, it is resolved to number.
With types = "number", it is also still number.
With some other type, e.g., types = "object", then the type is resolved to "type" : [ "number", "object" ]

@JsonProperty("value")
Double value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class TrackerData {
@JsonProperty("timestamp")
Instant timestamp;

@Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0")
@Schema(name = "value", types = "number", format = "double", description = "The data value", required = true, example = "19.0")
@JsonProperty("value")
Double value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
"booleanValueAsFourthParameter": {
"type": "boolean"
},
"listBlah": {
"type": "array",
"items": {
"description": "test"
"listBlah" : {
"type" : "array",
"description" : "test",
"items" : {
"type" : "string",
"description" : "test"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,9 @@
"type": "object",
"properties": {
"thing": {
"type" : "object",
"description": "Hello",
"oneOf": [
{
"$ref": "#/components/schemas/Foo"
},
{
"$ref": "#/components/schemas/Bar"
},
{
"$ref": "#/components/schemas/Foo"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MyModel {
/**
* The Thing.
*/
@Schema(description = "Hello", type = "object", oneOf = { Foo.class, Bar.class })
@Schema(description = "Hello", types = "object", oneOf = { Foo.class, Bar.class })
private Object thing;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class TrackerData {
/**
* The Value.
*/
@Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0")
@Schema(name = "value", types = "number", format = "double", description = "The data value", required = true, example = "19.0")
@JsonProperty("value")
Double value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class TrackerData {
/**
* The Value.
*/
@Schema(name = "value", type = "number", format = "double", description = "The data value", required = true, example = "19.0")
@Schema(name = "value", types = "number", format = "double", description = "The data value", required = true, example = "19.0")
@JsonProperty("value")
Double value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,9 @@
"description": "The type My model.",
"properties": {
"thing": {
"type": "object",
"description": "Hello",
"oneOf": [
{
"$ref": "#/components/schemas/Foo"
},
{
"$ref": "#/components/schemas/Bar"
},
{
"$ref": "#/components/schemas/Foo"
},
Expand Down