Open donndorf opened 2 weeks ago
For some reason the embedded pictures don't seems to work, any idea why?
@donndorf it's not a known bug, it's known now :)
Can you dig in and send a PR to fix it? Maybe there's a trick in the openapi schema that we are missing. If that's the case we can add a troubleshooting section to the docs explaining how to fix it.
I am not sure where a fix would have to go or where to find it in the codegen package, maybe i'll have a chance to look into it.
In the meantime i tried to generate a client via CLI to have something to compare it to. That helped a bit more in understanding it. Apparently the usage of the PetsIdGet200Response is standard procedure but it seems to be generated wrong when using the plugin.
Hello @ricardozanini,
I am trying to find the source of aforementioned Problem right now and possibly provide a fix. But i have to admit that i don't yet understand how the extension works.
What's the "Entrypoint" for triggering the code generation? How could i make use of a Debugger in this case? When i inspect the imported Library in my IDE i only see annotations, providers, META-INF and a few Config classes.
Any advice to help me get started would be appreciated.
@donndorf you can start here: https://github.com/quarkiverse/quarkus-openapi-generator/blob/main/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/codegen/OpenApiGeneratorCodeGenBase.java#L171
We read from the openapi
dir during build time and delegate the generation with custom Qute templates to the underlying generator. You can debug there from the unit tests we have in this very same maven module.
Or you can run mvn
command in any integration-tests
module with debug active and see how that works during the maven lifecycle.
Update after further testing and debugging: it seems that the problem might not be the quarkus plugin after all but rather the underlying openapi-generator itself. For some reason it's not able to properly resolve the "oneOf" in some cases.
So unless anyone else has this problem and thinks it's in the quarkus plugin, this can probably be closed.
May be related to https://github.com/OpenAPITools/openapi-generator/issues/15044.
Hello,
I am trying to generate a Client with following example yaml:
following classes are generated
The API looks like this:
It is using a PetsIdGet200Response Object instead of the "Pet" Parent class. This PetsIdGet200Response Object only includes the fields from the last defined "onOf", in this case the Dog. If i swap the order of cat and dog in the respone schema, the class changes and now has the fields of the "Cat" class.
Is this a known Bug? Or could it be wrong configuration on my side?
Thanks in advance!