[BUG] openapi-generator problem with nested oneOf?
See original GitHub issueDescription
The openapi-generator client generation crashes on the provided OpenAPI document, which passes validation both using openapi-generator validate and linting using speccy. It seems to be language independent (affects all languages I tried).
openapi-generator version
4.0.0-beta3
OpenAPI declaration file content or url
Gist of JSON here: https://gist.github.com/einarwh/c8526951c3080ddca7b3b791066bb9e3
Command line used for generation
No fancy options, just:
openapi-generator generate -i openapi.json -g csharp
Steps to reproduce
Save gist as e.g. openapi.json and run:
openapi-generator validate -i openapi.json
to verify that the document is valid and then
openapi-generator generate -i openapi.json -g csharp
to get error message complaining about ‘ResourceId’ model.
Related issues/PRs
Looks very similar to this: https://github.com/OpenAPITools/openapi-generator/issues/2610
Suggest a fix/enhancement
It seems that the problem is due to nested oneOf’s.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Related StackOverflow Question
Is there someone working on supporting oneOf and anyOf to be generated by the C# client generator?
The issue is beyond nested oneOf. Code generation fails if there’s an array within a oneOf. However, there’s no error if I change it to allOf or anyOf. Here’s a fancy example:
Error with generator 6.2.0:
Generator options: