Open charlesxsh opened 4 years ago
Bug still present in 5.4.0 too.
I fixed a solution by the PR https://github.com/OpenAPITools/openapi-generator/pull/12389 .
Bug still present in v7.8.0 Could be fixed using the following model.mustache file:
{{#models}}
{{#model}}
{{>partial_header}}
{{#description}}
"""
{{.}}
"""
{{/description}}
{{#isEnum}}
enum {{classname}} {
{{#allowableValues}}
{{#values}}
{{.}}
{{/values}}
{{/allowableValues}}
}
{{/isEnum}}
{{^isEnum}}
type {{classname}} {
{{#vars}}
{{#description}}
"""
{{.}}
"""
{{/description}}
{{baseName}}: {{datatypeWithEnum}}
{{/vars}}
}
{{/isEnum}}
{{/model}}
{{/models}}
Bug Report Checklist
Description
graphql-schema generator doesn't support reusable enum
openapi-generator version
4.3.0
OpenAPI declaration file content or url
Command line used for generation
npx openapi-generator generate -g graphql-schema -i example.yaml -o somedir
Steps to reproduce
Just run this command with schemas provided above, you will get an empty graphql file for this enum
Related issues/PRs
Suggest a fix