You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "ivivanov-bg (via GitHub)" <gi...@apache.org> on 2024/03/18 10:31:34 UTC

[I] OpenAPI model not considering mixins in natibe build [camel-quarkus]

ivivanov-bg opened a new issue, #5891:
URL: https://github.com/apache/camel-quarkus/issues/5891

   ### 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 the `swagger-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 bytes**
   In **Native** mode  openapi size (accessible on `/v1/openapi`) is **3653 bytes**
   (The difference comes mostly from `Components -> Schemas -> <DataType> -> jsonSchema` section)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] OpenAPI model not considering mixins in natibe build [camel-quarkus]

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on issue #5891:
URL: https://github.com/apache/camel-quarkus/issues/5891#issuecomment-2006258146

   Thanks @ivivanov-bg - yeah, it works by adding all the mixin classes and relavant JsonSerializer. I will prepare a PR with an integration test.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] OpenAPI model not considering mixins in natibe build [camel-quarkus]

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on issue #5891:
URL: https://github.com/apache/camel-quarkus/issues/5891#issuecomment-2005770166

   @ivivanov-bg what the mixin classes should be registered for reflection? I tried all class from `io.swagger.v3.core.jackson.mixin` but the native runner is producing an empty response now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] OpenAPI model not considering mixins in natibe build [camel-quarkus]

Posted by "ivivanov-bg (via GitHub)" <gi...@apache.org>.
ivivanov-bg commented on issue #5891:
URL: https://github.com/apache/camel-quarkus/issues/5891#issuecomment-2009330022

   I just tested it - it's working as expected now
   Thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] OpenAPI model not considering mixins in natibe build [camel-quarkus]

Posted by "ivivanov-bg (via GitHub)" <gi...@apache.org>.
ivivanov-bg commented on issue #5891:
URL: https://github.com/apache/camel-quarkus/issues/5891#issuecomment-2005903224

   Yes 
   Attached is updated sample-app
   [sample-app.zip](https://github.com/apache/camel-quarkus/files/14646312/sample-app.zip)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] OpenAPI model not considering mixins in natibe build [camel-quarkus]

Posted by "ivivanov-bg (via GitHub)" <gi...@apache.org>.
ivivanov-bg commented on issue #5891:
URL: https://github.com/apache/camel-quarkus/issues/5891#issuecomment-2005775981

   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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] OpenAPI model not considering mixins in natibe build [camel-quarkus]

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on issue #5891:
URL: https://github.com/apache/camel-quarkus/issues/5891#issuecomment-2005864187

   `io.swagger.v3.core.jackson.mixin.Schema31Mixin` and `Schema31Mixin.TypeSerializer` ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] OpenAPI model not considering mixins in natibe build [camel-quarkus]

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on issue #5891:
URL: https://github.com/apache/camel-quarkus/issues/5891#issuecomment-2003587576

   Thanks @ivivanov-bg - I will take a look.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] OpenAPI model not considering mixins in natibe build [camel-quarkus]

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng closed issue #5891: OpenAPI model not considering mixins in natibe build
URL: https://github.com/apache/camel-quarkus/issues/5891


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] OpenAPI model not considering mixins in natibe build [camel-quarkus]

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on issue #5891:
URL: https://github.com/apache/camel-quarkus/issues/5891#issuecomment-2008713165

   @ivivanov-bg can you check the fix with your reproducer? If it works, I will merge the PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org