How to use OpenAPI “oneOf” property with openapi-generator-maven-plugin when generating Spring code

Currently, openapi-generator doesn’t support oneOf. This is a capability that had been newly introduced with OpenAPI v3 (FYI, only v2 and below are called “Swagger”, it has then been renamed to OpenAPI). There are various generators (Java, Spring, lots of other languages). I have seen that contributions have been made during this year to enable oneOf support.

To sum up, it looks like you have to wait a bit more until you can exploit this feature of the OpenAPI v3 spec using the generator for Spring.

Edit: It’s also listed on the “short term roadmap”:

OAS3.0 features support: anyOf, oneOf, callbacks, etc

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)