Display enums in parameter info
See original GitHub issueQ | A |
---|---|
Bug or feature request? | Feature request |
Which Swagger/OpenAPI version? | 2.0, 3.0 |
Which Swagger-UI version? | 3.4.3 |
How did you install Swagger-UI? | http://editor.swagger.io |
Which browser & version? | N/A |
Which operating system? | N/A |
Demonstration API definition
2.0:
swagger: '2.0'
info:
title: test
version: 0.0.0
paths:
/report:
get:
parameters:
- in: query
name: rel_date
required: true
type: string
enum:
- today
- yesterday
- lastweek
responses:
200:
description: OK
3.0:
openapi: 3.0.0
info:
title: test
version: 0.0.0
paths:
/report:
get:
parameters:
- in: query
name: rel_date
required: true
schema:
type: string
enum:
- today
- yesterday
- lastweek
responses:
'200':
description: OK
Expected Behavior
The parameter info in the UI displays the enum values.
Current Behavior
The enum values are only displayed when we do “try it out” and are not displayed normally.
Context
Related to #3518.
Issue Analytics
- State:
- Created 6 years ago
- Comments:19 (15 by maintainers)
Top Results From Across the Web
How to get enum values if enum class is parameter in method ...
To get the enum values from a Class object, you can use Class.getEnumConstants() . If you want access to the getSequence() function.
Read more >Enums - Swagger
You can use the enum keyword to specify possible values of a request parameter or a model property. For example, the sort parameter...
Read more >ParameterAttributes Enum (System.Reflection) - Microsoft Learn
Defines the attributes that can be associated with a parameter. These are defined in ... Specifies that the parameter has field marshaling information....
Read more >Enum HOWTO — Python 3.11.1 documentation
Because Enums are used to represent constants we recommend using UPPER_CASE names for members, and will be using that style in our examples....
Read more >How To Send Enum Parameters To Forms
A developer can set an enum type in the 'Enum Type Parameter' property. And then set the specific enum value in 'Enum Parameter'...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@webron @shockey This was implemented in 3.9.0, right? (via PR https://github.com/swagger-api/swagger-ui/pull/3977)
🎉
I agree with @feenr that dropdown is bot the beat to display value.
@feenr, please consider two more things: