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 query parameter documented as int values #1515

Closed
mercer opened this issue Feb 3, 2020 · 3 comments
Closed

Enum query parameter documented as int values #1515

mercer opened this issue Feb 3, 2020 · 3 comments

Comments

@mercer
Copy link

mercer commented Feb 3, 2020

Swagger api for an endpoint that accepts an enum query is generated as in values.

I'm with Swashbuckle.AspNetCore.SwaggerGen 5.0.0 and netcoreapp2.2

image

The enum I use

image

My controller

image

Generated swagger api

image

Swashbuckle.AspNetCore.SwaggerGen 4.0.0 used to generate proper enum values

image

@domaindrivendev
Copy link
Owner

Dup of #1459. TL;DR this version defaults to honoring System.Text.Json (as opposed to Newtonsoft) serializer behavior. You need to expicitly opt-in to honoring Newtonsoft as described here in the readme

@mercer
Copy link
Author

mercer commented Feb 4, 2020

I'm with netcoreapp2.2, does this still apply? https://github.com/domaindrivendev/Swashbuckle.AspNetCore#systemtextjson-stj-vs-newtonsoft talks about netcoreapp3.0

@mercer
Copy link
Author

mercer commented Feb 4, 2020

It does apply; problem solved

image

@mercer mercer closed this as completed Feb 4, 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