-
Notifications
You must be signed in to change notification settings - Fork 124
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
[Bug] Codegen issue with enum #540
Comments
Hi @ihadabs , please share swagger file with this issue. (you can do this in private way vovanella95@mail.ru) |
A minimal {
"openapi": "3.0.3",
"paths": {
"/gen-intercom-hash": {
"post": {
"tags": ["Auth"],
"description": "Generates a hash for intercom based on user id + platform",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": { "platform": { "type": "string", "enum": ["web", "ios", "android"] } },
"additionalProperties": false
}
}
}
},
"responses": {
"200": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": { "hash": { "type": "string" } },
"required": ["hash"],
"additionalProperties": false
}
}
}
}
}
}
}
}
} |
@Vovanella95 any update on this? |
Hi @ihadabs , will look into it today! |
@ihadabs looks like I've fixed this issue yesterday. In latest master your issue is not reproduced (Everything generated without errors). WIll release new version of generator today! |
* Fixed generation of nullable objects * Fixed nullable properties generation * Added 202 to success response codes * Fixed generation of enums * Fixed generation of models and enums * Refactored swagger generator * Some optimizations and refactoring * Small fix * Fixed naming of response * Fixed #531 generation of names of Part * Some fixes and refactoring * Fixed tests * Updated readme * Updated analysis options * Reverted SDK version * Updated version * Implemented Issue #496 x-ms-enum support * Some fixes * Removed flutter analyse * Added enumNames to enumModel * Returned ability to generate x-enumNames #539 * Fixed tests * Fixed generation of multipart file type * Re-generated files * Fixed job run * Added 'Uri' to booked classes names * Fixed issue with duplicated enum field names * Pushed analysis options * Fixed case when allOf classes refer to allOf classes * Fixed Order model in example * Removed discriminator * Fixed ref * Add some improvements to enums generator * Updated pubspec and changelog * Fixed duplicated enum values * Removed not needed generated code * Fixed enums toJson generation * Fixed generation of custom model * Fixed #540 Generation of enum maps in case when no models defined --------- Co-authored-by: Uladzimir Paliukhovich <uladzimir_paliukhovich@epam.com>
* Fixed generation of nullable objects * Fixed nullable properties generation * Added 202 to success response codes * Fixed generation of enums * Fixed generation of models and enums * Refactored swagger generator * Some optimizations and refactoring * Small fix * Fixed naming of response * Fixed #531 generation of names of Part * Some fixes and refactoring * Fixed tests * Updated readme * Updated analysis options * Reverted SDK version * Updated version * Implemented Issue #496 x-ms-enum support * Some fixes * Removed flutter analyse * Added enumNames to enumModel * Returned ability to generate x-enumNames #539 * Fixed tests * Fixed generation of multipart file type * Re-generated files * Fixed job run * Added 'Uri' to booked classes names * Fixed issue with duplicated enum field names * Pushed analysis options * Fixed case when allOf classes refer to allOf classes * Fixed Order model in example * Removed discriminator * Fixed ref * Add some improvements to enums generator * Updated pubspec and changelog * Fixed duplicated enum values * Removed not needed generated code * Fixed enums toJson generation * Fixed generation of custom model * Fixed #540 Generation of enum maps in case when no models defined * Removed not needed file --------- Co-authored-by: Uladzimir Paliukhovich <uladzimir_paliukhovich@epam.com>
Originally posted by @ihadabs in #528 (comment)
@Vovanella95
Thanks for the hard work 👏❤️🙌.
I updated to the latest version and there are still some issues:
Files:
api.swagger.dart
api.swagger.g.dart
api.enums.swagger.dart
The following enum is defined in
api.enums.swagger.dart
It's used in
api.swagger.g.dart
There should be an import in
api.swagger.dart
, so the above errors disappear.Currently, it's imported but only like this:
In
api.swagger.dart
, another issue:One more thing:
dynamic?
can bedynamic
, just to make analyzer happy lolThe text was updated successfully, but these errors were encountered: