-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
When openapi not contains format field for integer type, it is generated as Int32 C# equivalent type #167
Comments
@vinaymadupathi Thanks for taking the time to report this. I'll see what I can do. I will most likely not just enforce a |
@all-contributors please add @vinaymadupathi for bugs |
I've put up a pull request to add @vinaymadupathi! 🎉 |
I'd argue that just using if this comes from an external source, it would be wise to tell the creator of the spec about the flaw in the openapi doc. |
I agree this is the correct course of action to take in this situation.
I've dealt with quite a lot of these bad OpenAPI specs myself, and when it comes to large corporate vendors, I noticed that informing them that there are errors in the spec doesn't necessarily mean that anything will be done about it. The worst case is that it remains as it is or gets fixed in a future release. You have probably tried this as well @kirides In these cases, I take a copy of the spec and adjust it locally. At the end of the day, HTTP API's use JSON, and there are only 3 primitive data types in JSON, so regardless of what numeric data type you use in C# it will always come out as a number I'm guessing that the use case of @vinaymadupathi is to use tooling to skip adjusting the OpenAPI spec locally. Is this correct? |
When openapi doesn't specify format for integer type, generated property is of Int32 whereas the value could be in Int64 range, so is it not better to generate property of type Int64 ?
Refer Open API specs for Integer (https://swagger.io/docs/specification/data-models/data-types/#numbers)
The text was updated successfully, but these errors were encountered: