-
I have an enum which looks like this: public enum RegisterHistoryEnvironment {
XML,
DATABASE;
} This is rendered with every value twice: In the code, that's how it's defined: @Parameter(required = false, description = "...")
@QueryParam("environment") @DefaultValue("DATABASE") final RegisterHistoryEnvironment environment And this is how it's generated: {
"name" : "environment",
"in" : "query",
"required" : false,
"schema" : {
"allOf" : [ {
"$ref" : "#/components/schemas/RegisterHistoryEnvironment"
}, {
"default" : "DATABASE"
} ]
} With our old toolchain it was generated like this: {
"name" : "environment",
"in" : "query",
"schema" : {
"type" : "string",
"enum" : [ "XML", "DATABASE" ],
"default" : "XML"
}
} And that showed the correct drop-down values in SwaggerUI. If I omit the default value, it's generated in a different way and then shows the correct drop-down values in SwaggerUI: {
"name" : "environment",
"in" : "query",
"required" : false,
"schema" : {
"$ref" : "#/components/schemas/RegisterHistoryEnvironment"
}
} Am I doing something wrong or is SmallRye generated something it shouldn't? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
How does |
Beta Was this translation helpful? Give feedback.
-
Ok, I created a simple example in project A: @GET
@Path("/foo")
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "...")
public Response foo(
@Parameter(required = false)
@QueryParam("environment") @DefaultValue("DATABASE") final RegisterHistoryEnvironment environment) {
return Response.ok().build();
} This results in the following in "/api/foo" : {
"get" : {
"summary" : "...",
"parameters" : [ {
"name" : "environment",
"in" : "query",
"required" : false,
"schema" : {
"allOf" : [ {
"$ref" : "#/components/schemas/RegisterHistoryEnvironment"
}, {
"default" : "DATABASE"
}, {
"$ref" : "#/components/schemas/RegisterHistoryEnvironment"
}, {
"default" : "DATABASE"
} ]
}
} ],
"responses" : {
"200" : {
"description" : "OK"
}
}
}
} By the way, I'll be away on holidays for the next two weeks, so please be patient with answers after today :-) |
Beta Was this translation helpful? Give feedback.
-
@MikeEdgar Back from holidays :-) Any news on this question? |
Beta Was this translation helpful? Give feedback.
4.0.x for sure. If it's not too complicated to backport to 3.1.x then it can be queued up for a bug fix there as well.