We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Enums that are declared inside models are generated with incorrect names.
7.5.0 - issue appeared 7.6.0 - issue reproduced
{ "openapi": "3.0.1", "info": { "title": "Test.Api", "version": "1.0.0" }, "components": { "schemas": { "User.Model": { "required": [ "userType", "name" ], "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer" }, "userType": { "enum": [ "MALE", "FEMALE", "ANIMAL" ], "type": "string" } } } } } }
results into:
data class UserModel ( @Json(name = "name") val name: kotlin.String, @Json(name = "userType") val userType: UserModel.UserType, @Json(name = "age") val age: kotlin.Int? = null ) { enum class userType(val value: kotlin.String) { @Json(name = "MALE") MALE("MALE"), @Json(name = "FEMALE") FEMALE("FEMALE"), @Json(name = "ANIMAL") ANIMAL("ANIMAL"); } }
here enum name conflicts with the property name giving an error:
task.additionalProperties = [ useCoroutines: "true", library : "jvm-retrofit2", sourceFolder : "src/main/java", ] task.globalProperties = [ apiDocs : "false", apiTests : "false", modelDocs : "false", modelTests : "false", apis : "", models : "", supportingFiles: "CollectionFormats.kt" ] task.configOptions = [ dateLibrary : "java8-localdatetime", enumPropertyNaming: "UPPERCASE", moshiCodeGen : "true" ] task.typeMappings = [ "URI" : "kotlin.String", "ByteArray" : "kotlin.String", ]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug Report Checklist
Description
Enums that are declared inside models are generated with incorrect names.
openapi-generator version
7.5.0 - issue appeared
7.6.0 - issue reproduced
OpenAPI declaration file content or url
results into:
here enum name conflicts with the property name giving an error:
![image](https://private-user-images.githubusercontent.com/87310984/332078684-8af54af7-d1ec-4644-8ae3-ef4ab29304d7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgyOTg2NTYsIm5iZiI6MTcxODI5ODM1NiwicGF0aCI6Ii84NzMxMDk4NC8zMzIwNzg2ODQtOGFmNTRhZjctZDFlYy00NjQ0LThhZTMtZWY0YWIyOTMwNGQ3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjEzVDE3MDU1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ3NTNmN2E3NjZiYTEzY2E4NTM4MjBkNTJhMjY5ZWU4NjNhZmY5MzQxNTg1YzAyYmNjYWZmNTdiYzQyYmNiZGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.bbZZ6Hh2sxwWC3V4lWd3IyVVWnwBqSh3qr45XRtC8Gw)
Generation Details
The text was updated successfully, but these errors were encountered: