New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenAPI model not considering mixins in natibe build #5891
Comments
Thanks @ivivanov-bg - I will take a look. |
@ivivanov-bg what the mixin classes should be registered for reflection? I tried all class from |
That's exacrly what I observed too and the reason to not privide a PR directly. My cussrent issue (with the jsonSchema) gets resolved if the Schema31 mixin and the inner type serializer are registered, but to me this looked more like a workaround for particular situation |
|
Yes But again - this only fixes my problem (and only partially) |
Thanks @ivivanov-bg - yeah, it works by adding all the mixin classes and relavant JsonSerializer. I will prepare a PR with an integration test. |
@ivivanov-bg can you check the fix with your reproducer? If it works, I will merge the PR. |
I just tested it - it's working as expected now |
Bug description
When using
camel-quarkus-openapi-java
generation of the OpenAPI specification in native mode doesn't take into account the mixins specified in theswagger-core
library:https://github.com/swagger-api/swagger-core/blob/3fcc473c33c56f306902853a451020926ad691ea/modules/swagger-core/src/main/java/io/swagger/v3/core/util/ObjectMapperFactory.java#L244
In JVM mode - everything works as expected.
The root cause of the issue is that the mixins are abstract classes without any children, so they get stripped during native build.
As a result - the OpenAPI document might become very big (in case of complex data model) and make swagger UI completely unresponsive.
The extension should register the mixins for reflection to prevent flooding openapi json with unnecessary data.
Attached is sample reproduces:
[sample-app.zip](https://github.com/apache/camel-quarkus/files/14634597/sample-app.zip)
In JVM mode openapi size (accessible on
/v1/openapi
) is 1502 bytesIn Native mode openapi size (accessible on
/v1/openapi
) is 3653 bytes(The difference comes mostly from
Components -> Schemas -> <DataType> -> jsonSchema
section)The text was updated successfully, but these errors were encountered: