OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
[ ] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
If the crystal generator is used, and the templates partial_model_generic.mustache, base_object.mustache or partial_oneof_module.mustache are instanced, we generate code using ....get_const(...) which isn't a thing in crystal, so the resulting code is unusable. (see https://github.com/crystal-lang/crystal/issues/8180 for proof of no const_get in crystal)
openapi-generator version
This seems to be from crystal introduction until latest master branch. (b3ec7faa8fc)
Reproducing
I encounter it when creating enum schemas, which is only used as a subtype in the petstore example which makes this not occur.
...
content:
schema:
type: string
enum:
- "a"
- "b"
Using some spec with the above contents trigger it.
Suggest a fix
The generator files mentioned should be fixed so it is not producing ruby code that doesn't work in crystal.
Bug Report Checklist
Description
If the crystal generator is used, and the templates
partial_model_generic.mustache
,base_object.mustache
orpartial_oneof_module.mustache
are instanced, we generate code using....get_const(...)
which isn't a thing in crystal, so the resulting code is unusable. (see https://github.com/crystal-lang/crystal/issues/8180 for proof of noconst_get
in crystal)openapi-generator version
This seems to be from crystal introduction until latest master branch. (b3ec7faa8fc)
Reproducing
I encounter it when creating enum schemas, which is only used as a subtype in the petstore example which makes this not occur.
Using some spec with the above contents trigger it.
Suggest a fix
The generator files mentioned should be fixed so it is not producing ruby code that doesn't work in crystal.