You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The swagger-maven-plugin does not appear to be generating an object type for @Schema defaultValue. Instead, it generates just the original String. Other annotations in @Schema (e.g. example) do generate the correct object type.
The swagger-maven-plugin does not appear to be generating an object type for @Schema defaultValue. Instead, it generates just the original String. Other annotations in @Schema (e.g. example) do generate the correct object type.
String SAMPLE = "{ "enabled": false, "interval": 30, "intervalUnit": "minute", "attempts": 6, "timePeriod": 5, "timePeriodUnit": "minute" }";
@Schema(description = "Description", example = SAMPLE defaultValue = SAMPLE)
public MyObject importMyObject;
Generated output from swagger-maven-plugin below. Notice the "default" is String whereas "example" is an object
"MyObject" : {
"type" : "object",
"properties" : {
"enabled" : {
"type" : "boolean"
},
"attempts" : {
"type" : "integer",
"format" : "int64"
},
"timePeriod" : {
"type" : "integer",
"format" : "int64"
},
"timePeriodUnit" : {
"type" : "string",
"enum" : [ "week", "day", "hour", "minute", "second" ]
},
"lockTimePeriod" : {
"type" : "integer",
"format" : "int64"
},
"lockTimePeriodUnit" : {
"type" : "string",
"enum" : [ "week", "day", "hour", "minute", "second" ]
}
},
"description" : "Description",
"example" : {
"enabled" : false,
"interval" : 30,
"intervalUnit" : "minute",
"attempts" : 6,
"timePeriod" : 5,
"timePeriodUnit" : "minute"
},
"default" : "{ "enabled":false, "interval": 30, "intervalUnit": "minute", "attempts": 6, "timePeriod": 5, "timePeriodUnit": "minute" }"
}
The text was updated successfully, but these errors were encountered: