Open marcocunha opened 4 years ago
I guess this is not specific to the typescript-angular
generator but a general issue.
@marcocunha would you like to implement a fix?
I can confirm this is a general typescript
wide issue. My guess is somewhere in the DefaultCodegen
class file
It is actually true for all templates: https://github.com/OpenAPITools/openapi-generator/blob/3adfdfafea183dfc4a1edf9a8df42f68657f662c/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java#L448-L450
Not sure what the intention was, but maybe this should also be handled with generateAliasAsModel
, as it’s an alias for object
.
I would love to see a soltution for the bug! Any Progress so far?
We are facing the same issue. any news?
The example in the original post seems invalid. I have created a working example here: https://github.com/bodograumann/openapi-generator-issue-4119 As you can see there are no models generated.
Unfortunately I can currently not develop on openapi-generator due to #8455.
@bodograumann this happens when your java version is 10. Can you switch your java version to v11?
I was still getting the same free-form error as of openapi 3.0 and generator-cli 6.2 with typescript-fetch. Adding this option to the generator caused the model to be extracted for me:
--additional-properties=generateAliasAsModel=true
Bug Report Checklist
Description
I'm trying to generate the typescript models, based on the schemas defined in the YAML file, but there is a model (free-form object) that is not being generated and according to the log:
Is relevant to mention that this problem started happening after the migration from Swagger 2.x version to OpenAPI 3.0 and I also started using this new openapi-generator version
openapi-generator version
4.1.3
OpenAPI declaration file content or url
Command line used for generation
mvn clean generate-resources
Steps to reproduce
Using a valid open API 3.0 YAML file, declare the schema referred above and generate the typescript model using the following pom configuration:
Related issues/PRs
Suggest a fix
I was expecting a typescript similar to: