Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enums in Swagger UI #28

Closed
ralpha opened this issue May 11, 2020 · 1 comment
Closed

Enums in Swagger UI #28

ralpha opened this issue May 11, 2020 · 1 comment

Comments

@ralpha
Copy link
Contributor

ralpha commented May 11, 2020

Swagger UI has a bug, ... already for 3 years. Were is handles enum without a typepoorly.
See: swagger-api/swagger-ui#3761
A quick fix for this is adding a type: string item to the schema.

"RegionType": {
  "description": "...",
  "type": "string",   <----Add_this_line
  "enum": [
    "Swamp",
    "Desert",
    "...",
    "Unknown"
  ]
}

Adding the line above will change the output in Swagger UI from:
Screenshot from 2020-05-12 00-24-07
To This:
Screenshot from 2020-05-12 00-24-26

It would be cool if this can be fixed here.
Btw love this crate and the others you made. (I'm also using okapi and rocket_okapi.)

GREsau added a commit that referenced this issue May 16, 2020
@GREsau
Copy link
Owner

GREsau commented May 16, 2020

Thanks for raising this, it's now fixed in v0.7.4 🙂

@GREsau GREsau closed this as completed May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants