Open Adi1231234 opened 3 years ago
java (jersey2, natvie), csharp-netcore, powershell, python, ruby and go have better support for oneOf. Please give these a try when you've time.
Hi @wing328, are there any plans on adding support for other languages ? I'm working with the openapi to proto generator and I noticed the same. Was trying to map openapi's oneOf
to protobuf's oneof
. Or at least some pain points / checklist you identified for properly implementing this (i.e. where to add code in the codegen to get it working).
We definitely want to add oneOf, anyof support to all generators. At this stage, we rely on contributions from the community to implement the feature with reference to the generators that support these features or those who need these features with a higher priority can consider sponsoring the tasks to make it a higher priority among the community.
For your case, we welcome contributions from you to add oneOf
support to the protobuf-schema generator or you can sponsor the enhancement to have it done by the community.
java (jersey2, natvie), csharp-netcore, powershell, python, ruby and go have better support for oneOf. Please give these a try when you've time.
csharp-netcore does not generate compilable code for OneOf
nor AnyOf
, just like in the provided report.
jersey2 and native does not work either
Bug Report Checklist
Description
On
oneOf
usage in openAPI declaration the generator try to use oneOf* model but does not create it in any languageopenapi-generator version
5.0.1
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
execute -
java -jar openapi-generator-cli.jar generate -i categories.swagger -o out -g (any language)
then at api/categories_api the generated function is:
the problem is that
OneOfGetManyCategoryResponseDtoarray
class does not exist in any file.Related issues/PRs
#3965 - Similar a bit
Suggest a fix