Skip to content
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

Smallrye OpenAPI Additional Docs Missing in Native Image #22349

Closed
watermelonjam opened this issue Dec 18, 2021 · 2 comments · Fixed by #22523
Closed

Smallrye OpenAPI Additional Docs Missing in Native Image #22349

watermelonjam opened this issue Dec 18, 2021 · 2 comments · Fixed by #22523
Assignees
Labels
Milestone

Comments

@watermelonjam
Copy link
Contributor

Describe the bug

I require Quarkus to present different OpenAPI securitySchemes in different deployment environments. I'm attempting to do this by using the quarkus.smallrye-openapi.additional-docs-directory and an environment variable (one of "qa" or "prod"). The securitySchemes are stored in subdirectories of META-INF/openapi and my application.yaml instructs the native executable builder to use these resources:

quarkus:
  smallrye-openapi:
    auto-add-security: false
    additional-docs-directory: META-INF/openapi/${openapi-security:prod}
  native:
    builder-image:
      quay.io/quarkus/ubi-quarkus-native-image:21.3-java17
    resources:
      includes: "META-INF/openapi/**"

This works when running in the JVM (OpenJDK Runtime Environment 21.9 (build 17.0.1+12-LTS)), but not in the native executable. I've created a reproducible test of the behaviour. I know the native resource includes are having some effect, running strings on the executable and grepping for tokenUrl shows me what I want to see. quarkus-smallrye-openapi can't seem to load them though.

Expected behavior

Native executable should produce an OpenAPI spec at /q/openapi that includes the securityScheme defined in META-INF/openapi/prod/security-scheme.yaml

Actual behavior

Native executable produces no securitySchemes at all.

How to Reproduce?

git clone https://github.com/watermelonjam/openapi-docs-bug.git
mvn clean verify -Pnative

Output of uname -a or ver

Linux vpn-netw-90-232.ipreg.mcmaster.ca 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 8 13:30:15 EST 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "17.0.1" 2021-10-19 LTS OpenJDK Runtime Environment 21.9 (build 17.0.1+12-LTS) OpenJDK 64-Bit Server VM 21.9 (build 17.0.1+12-LTS, mixed mode, sharing)

GraalVM version (if different from Java)

quay.io/quarkus/ubi-quarkus-native-image:21.3-java17

Quarkus version or git rev

2.5.2-Final

Build tool (ie. output of mvnw --version or gradlew --version)

Maven home: /home/arnoldd/apache-maven-3.8.3 Java version: 17.0.1, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-17-openjdk-17.0.1.0.12-2.el8_5.x86_64 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.18.0-348.2.1.el8_5.x86_64", arch: "amd64", family: "unix"

Additional information

No response

@watermelonjam watermelonjam added the kind/bug Something isn't working label Dec 18, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Dec 18, 2021

@phillip-kruger
Copy link
Member

Thanks for this. I have create a fix for this and will do a PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants