-
Notifications
You must be signed in to change notification settings - Fork 58
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
Latest Preview 1.0 - beta4 - Enum inferred type is int #186
Comments
I have the same issue, schema: ... with SwaggerProwider 0.12 (NewtonSoft serialization) it used to serialize to |
The real problem here is that NewtonSoft is already running at v13, and SwaggerProvider 0.12 package has a fixed dependency: [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/) (>= 12.0.3 && < 12.1.0) I hope @sergey-tihon will release SwaggerProvider 0.12.2 having relaxed the NewtonSoft max version for people who want to continue using working serialization. Edit: Here is a PR (which cannot be merged to master) |
@Thorium 0.12.2 is release - https://www.nuget.org/packages/SwaggerProvider/0.12.2 and thanks for the fix. @jkone27 can you share the full schema with the issue and code snippet (what TP you used? SwaggerProvider or OpenApiProvider?) |
Here is a random schema for SwaggerProvider that has the enum-issue: |
I used OpenApiProvider, dont have the schema with me rn but i hope @Thorium provided one is as good to reproduce |
Should be fixed in SwaggerProvider 2.0.0-beta2 |
@sergey-tihon As I commented elsewhere, I would really appreciate having ability to have enum/discriminated union generated upon swagger schema when applicable. Should I create another issue for it? |
Description
https://swagger.io/docs/specification/data-models/enums/
and SwaggerProvider generated type instead is int, wheras should be string (or eventually an Enum with valid values, before it was string with the old "LTS" package
This causes new generate types not to be compatible with "old" ones.
The text was updated successfully, but these errors were encountered: