Bug Report Checklist
Description
The OpenAPI Generator v5.3.1 & 5.3.0 does not generate a OneOf-Model-Class which results in the code not being able to be built. I found the exact same issue in Java jersey2, Java native (and Rust reqwest). This confuses me as the Java generators are supposed to support OneOf (#10463 (comment) and #7263). I expected the Generator to support OneOf in Java as these two links say.
openapi-generator version
5.3.1 & 5.3.0
OpenAPI declaration file content or url
https://raw.githubusercontent.com/jdegre/5GC_APIs/master/TS29510_Nnrf_NFManagement.yaml
Generation Details
(Jersey2)
java -jar openapi-generator-cli-5.3.1-20211116.151401-16.jar generate -i Desktop/5GC_APIs/TS29510_Nnrf_NFManagement.yaml -g java -o Desktop/NRFManagement_java_jersey2 --library jersey2 --additional-properties=packageName=nfmanagement
OR
(Native)
java -jar openapi-generator-cli-5.3.1-20211116.151401-16.jar generate -i Desktop/5GC_APIs/TS29510_Nnrf_NFManagement.yaml -g java -o Desktop/NRFManagement_java_native --library native --additional-properties=packageName=nfmanagement
Steps to reproduce
- Generate Code of NFManagement with OpenAPI Generator (with Generation Details above)
- Try to build it
- Search for Error "Cannot resolve symbol 'OneOfNfInstanceIdCondNfInstanceIdListCondNfTypeCondServiceNameCondAmfCondGuamiListCondNetworkSliceCondNfGroupCondNfSetCondNfServiceSetCondUpfCondScpDomainCondNwdafCondNefCondDccfCond'"
Related issues/PRs
#9791
#10514
#9981
Suggest a fix
The error is caused by "TS29510_Nnrf_NFManagement.yaml" line 1449-1465. Might be worth looking into.
subscrCond:
oneOf:
- $ref: '#/components/schemas/NfInstanceIdCond'
- $ref: '#/components/schemas/NfInstanceIdListCond'
- $ref: '#/components/schemas/NfTypeCond'
- $ref: '#/components/schemas/ServiceNameCond'
- $ref: '#/components/schemas/AmfCond'
- $ref: '#/components/schemas/GuamiListCond'
- $ref: '#/components/schemas/NetworkSliceCond'
- $ref: '#/components/schemas/NfGroupCond'
- $ref: '#/components/schemas/NfSetCond'
- $ref: '#/components/schemas/NfServiceSetCond'
- $ref: '#/components/schemas/UpfCond'
- $ref: '#/components/schemas/ScpDomainCond'
- $ref: '#/components/schemas/NwdafCond'
- $ref: '#/components/schemas/NefCond'
- $ref: '#/components/schemas/DccfCond'
Bug Report Checklist
Description
The OpenAPI Generator v5.3.1 & 5.3.0 does not generate a OneOf-Model-Class which results in the code not being able to be built. I found the exact same issue in Java jersey2, Java native (and Rust reqwest). This confuses me as the Java generators are supposed to support OneOf (#10463 (comment) and #7263). I expected the Generator to support OneOf in Java as these two links say.
openapi-generator version
5.3.1 & 5.3.0
OpenAPI declaration file content or url
https://raw.githubusercontent.com/jdegre/5GC_APIs/master/TS29510_Nnrf_NFManagement.yaml
Generation Details
(Jersey2)
java -jar openapi-generator-cli-5.3.1-20211116.151401-16.jar generate -i Desktop/5GC_APIs/TS29510_Nnrf_NFManagement.yaml -g java -o Desktop/NRFManagement_java_jersey2 --library jersey2 --additional-properties=packageName=nfmanagement
OR
(Native)
java -jar openapi-generator-cli-5.3.1-20211116.151401-16.jar generate -i Desktop/5GC_APIs/TS29510_Nnrf_NFManagement.yaml -g java -o Desktop/NRFManagement_java_native --library native --additional-properties=packageName=nfmanagement
Steps to reproduce
Related issues/PRs
#9791
#10514
#9981
Suggest a fix
The error is caused by "TS29510_Nnrf_NFManagement.yaml" line 1449-1465. Might be worth looking into.