OpenAPITools / OpenAPITools/openapi-generator
[BUG] csharp - oneOfStringArray and oneOfString not compiling to code properly. Sample config attached.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
I just downloaded the latest generator tool and when generating csharp-netcore instead of creating the right schema it creates the type OneOfstringArray as an invalid "type". To be clear, everything gets created but there are a few fields that do not compile when opening up the solution so I have to edit them manually. I know oneOf isn't fully supported yet, want to keep this issue open to keep visibility on it.
THANKS FOR ALL THAT YOU DO!
openapi-generator version
4.3.0
OpenAPI declaration file content or url
Components -> schemas section
https://gist.github.com/thedonmon/da508473db9c02942afa47a7c3ad1e4a
Command line used for generation
openapi-generator generate -g csharp-netcore -i "schema.json"
Steps to reproduce
run command above, open solution file, try to build the project and see where the errors point to the "Invalid type OneOfstringarray" or "OneOfstring"
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/issues/2311
Suggest a fix
Either the json schema on my end needs to be cleaned up or there needs to be a way to combine the two types. I believe I can help locate the issue need to dig into the code to see how to handle this scenario.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the OpenAPI declaration in the linked gist and reproduce it using schema.json with the shown csharp-netcore generation command. Inspect the generated solution for the invalid OneOfstringArray and OneOfstring types; done means the generated C# project builds without those compilation errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, java
- Domain
- api, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100