consilience / openapi-generator-psr18

Templates to generate a PSR-18/PSR-17/PSR-7 client package for PHP
Apache License 2.0
2 stars 0 forks source link

Generator not creating classes for OneOf #3

Open judgej opened 5 years ago

judgej commented 5 years ago

Some details logged here, as I suspect it may be related:

https://github.com/OpenAPITools/openapi-generator/issues/2906

The OneOf class is expected by the deserialiser when handling a response. Possibly there should not be a class, and the deserialiser should check the datatype and handle it appropriately. I'm not sure how that would work anyway, as the missing class OneOfSimpleAuthorisationString, which represents either a SimpleAuthorisation or a String, feels more like an interface. But I don't know what the thinking is behind it.

judgej commented 5 years ago

@bradydan This is the generation issue we just talked about, where the model builder (aka response deserialiser) is either not generating some models it should be generating, or it is attempting to use some models that should not be generated anyway. The problem could be anywhere in the generation process, from the initial parsing, spec normalisation, language abstract, or language override (the output "flavour"). I simply have no idea where it is at the moment.

We may be able to work around it in our API specs, but when pulling in third party specs (e.g. Xero) then we will have no choice but to support it. That is, assuming it is not simply a syntactical error in my OpenAPI spec. I'm new to this ;-)