-
I'm trying to integrate the vert.x OpenAPI Router into a Quarkus Native app. I obtain the router object and mount the result of the OpenAPI as sub router. // Paraphrasing here
public void init(@Observes Router rootRouter) {
OpenAPIContract.from(vertx, spec)
.onSuccess(contract -> {
Router router = RouterBuilder.create(vertx, contract).createRouter()
rootRouter.route("/api").subRouter(router);
});
} Works like a charm. Until I tried to pack it in a native container with jib and quarkus-micro-image:2.0. When I run it, it fails with an error:
Interestingly https://son-schema.org/draft/2020-12/schema is a working URL. So it seems the OpenAPI router wants to call out and can't from the container? What do I miss? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 15 replies
-
/cc @EricWittmann (openapi), @MikeEdgar (openapi), @geoand (jib), @phillip-kruger (openapi), @zakkak (native-image) |
Beta Was this translation helpful? Give feedback.
-
Update: the issue seems with the native executable, When I start the runner in target, I get the same error:
|
Beta Was this translation helpful? Give feedback.
-
I had a look and the problem is that you need to have the files in the That's why we have Quarkus extensions: we tweak the native image building configuration. Given we don't have an extension for this component, you need to tweak it yourself. See https://quarkus.io/guides/writing-native-applications-tips#including-resources to know how you can easily include additional resources with a pattern. Just include anything in the Note that it will solve this particular issue, there might be others. |
Beta Was this translation helpful? Give feedback.
@Stwissel this seems related to the glob pattern being passed to
quarkus.native.resources.includes
In the reproducer
**/*.json
gets translated to the regex.*/[^/]*\\.json
, which doesn't matchtest.json
because it needs at least one/
. If you remove the/
and pass***.json
it will work.Now my understanding is that
**/*.json
is expected to match alljson
files (see here), includingtest.json
, which indicates thatquarkus/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/util/GlobUtil.java
Line 65 in f959510