enum values not displayed in example/model view (resubmitted using template)
See original GitHub issueENUM values in the schema definition are not displayed in the example/model view sections of the swagger-ui page.
Q | A |
---|---|
Bug or feature request? | Bug |
Which Swagger/OpenAPI version? | 2.0 |
Which Swagger-UI version? | 3.3.1 |
How did you install Swagger-UI? | embedded in swagger-tools module |
Which browser & version? | Safari Version 11.0 (12604.1.38.1.7) |
Which operating system? | macOS Sierra Version 10.12.6 (16G29) |
Demonstration API definition
accessTokenReq:
type: object
properties:
grant_type:
enum:
- client_credentials
client_id:
type: string
client_secret:
type: string
Expected Behavior
Rendered by UI:
Example section:
{
"grant_type": "client_credentials",
"client_id": "string",
"client_secret": "string"
}
Model section
accessTokenReq {
grant_type = ['client_credentials'],
client_id | string
client_secret | string
}
Current Behavior
Rendered by UI:
Example section:
{
"client_id": "string",
"client_secret": "string"
}
Model section
accessTokenReq {
grant_type {
}
client_id | string
client_secret | string
}
Possible Solution
Context
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
DisplayTemplate for Enum not working for some values
I have a model as enum class named Priority. I have an editor template for Priority and a display template for Enum. In...
Read more >Picker driven by enum | Apple Developer Forums
SwiftUI will use this to map from views to enum case values. ... enum Sample: String, Equatable, CaseIterable { case first = "First"...
Read more >Enum dropdown with readable values in rails
If you have a model, which has an enum attribute and you want to have a select tag(dropdown) with titleized values(no ugly underscores)...
Read more >Enterprise Architect Object Model | Sparx Systems
If this does not appear, go to the command line and ... The enum values defined here are used exclusively for the ......
Read more >swagger vendor extensions example
Changes to this prop's value will not be propagated to the underlying Swagger UI instance. ... Example using Vendor Extensions in Swagger Template...
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
While this is a bug, you can easily overcome it by explicitly adding the type.
Any updates in this issue?