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

Enum array support #1353

Open
bwbroersma opened this issue Jul 18, 2019 · 2 comments

Comments

@bwbroersma
Copy link

commented Jul 18, 2019

Enum looks nice in SwaggerUI, enum arrays do not.
Here the changes that work for me for nice SwaggerUI output, but it might not be correct for the OpenAPI standard: code diff

@bwbroersma

This comment has been minimized.

Copy link
Author

commented Jul 25, 2019

Ok the previous commit / provided solution is not the correct way to do it, this will also result in an
Example Value

{
  "the-enum-array-field": "first-value"
}

were we would want more something like

{
  "the-enum-array-field": ["first-value"]
}
@bwbroersma

This comment has been minimized.

Copy link
Author

commented Jul 26, 2019

The correct Swagger to output (according to the docs) is:

{
  "format": "schema.typename[]",
  "type": "array",
  "items": {
    "type": "string",
    "enum": ["first-value", "second-value"]
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.