Skip to content
\n

This is rendered with every value twice:

\n

\"screenshot\"

\n

In the code, that's how it's defined:

\n
      @Parameter(required = false, description = \"...\")\n      @QueryParam(\"environment\") @DefaultValue(\"DATABASE\") final RegisterHistoryEnvironment environment
\n

And this is how it's generated:

\n
         {\n          \"name\" : \"environment\",\n          \"in\" : \"query\",\n          \"required\" : false,\n          \"schema\" : {\n            \"allOf\" : [ {\n              \"$ref\" : \"#/components/schemas/RegisterHistoryEnvironment\"\n            }, {\n              \"default\" : \"DATABASE\"\n            } ]\n          }
\n

With our old toolchain it was generated like this:

\n
        {\n          \"name\" : \"environment\",\n          \"in\" : \"query\",\n          \"schema\" : {\n            \"type\" : \"string\",\n            \"enum\" : [ \"XML\", \"DATABASE\" ],\n            \"default\" : \"XML\"\n          }\n        }
\n

And that showed the correct drop-down values in SwaggerUI.

\n

If I omit the default value, it's generated in a different way and then shows the correct drop-down values in SwaggerUI:

\n
        {\n          \"name\" : \"environment\",\n          \"in\" : \"query\",\n          \"required\" : false,\n          \"schema\" : {\n            \"$ref\" : \"#/components/schemas/RegisterHistoryEnvironment\"\n          }\n        }
\n

Am I doing something wrong or is SmallRye generated something it shouldn't?

","upvoteCount":1,"answerCount":3,"acceptedAnswer":{"@type":"Answer","text":"

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.

","upvoteCount":0,"url":"https://github.com/smallrye/smallrye-open-api/discussions/1996#discussioncomment-11052152"}}}
Discussion options

You must be logged in to vote

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.

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
2 replies
@cristalp
Comment options

@MikeEdgar
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@MikeEdgar
Comment options

@cristalp
Comment options

@MikeEdgar
Comment options

Answer selected by cristalp
@cristalp
Comment options

@cristalp
Comment options

@MikeEdgar
Comment options

@cristalp
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants