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

Impossible to change OpenApi document URL via application.properties #2756

Closed
belyaev-andrey opened this issue Jun 7, 2019 · 0 comments · Fixed by #2779
Closed

Impossible to change OpenApi document URL via application.properties #2756

belyaev-andrey opened this issue Jun 7, 2019 · 0 comments · Fixed by #2779
Labels
kind/bug Something isn't working
Milestone

Comments

@belyaev-andrey
Copy link

Describe the bug
If you add a property quarkus.smallrye-openapi.path to change an OpenApi doc location (I don't like /openapi personally) it fails if you specify something like

quarkus.smallrye-openapi.path=/api/openapi.yaml

Error is:

java.io.FileNotFoundException: /api/quarkus-generated-openapi-doc.YAML
	at io.undertow.servlet.handlers.DefaultServlet.doGet(DefaultServlet.java:173)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:686

Expected behavior
OpenApi document is downloaded

Actual behavior
Error 500

To Reproduce
Steps to reproduce the behavior:

  1. clone https://github.com/quarkusio/quarkus-quickstarts
  2. cd to quarkus-quickstarts/using-openapi-swaggerui folder
  3. open src/main/resources/application.properties
  4. add quarkus.smallrye-openapi.path=/api/openapi line to this file
  5. run the application by executing mvn compile quarkus:dev in the quarkus-quickstarts/using-openapi-swaggerui folder
  6. Open http://localhost:8080/swagger-ui/ URL
  7. Open http://localhost:8080/api/openapi

Observe the error

Configuration

# Configuration file
# key = value
quarkus.smallrye-openapi.path=/api/openapi

Environment (please complete the following information):

  • Output of java -version:
java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)       
  • Quarkus version or git rev: 0.16.1

Additional context
I think that the problem is that you don't take into account this configuration property while generating OpenApi file and creating the following constants:

    public static final String GENERATED_DOC_BASE = "quarkus-generated-openapi-doc.";
    public static final String BASE_NAME = "META-INF/resources/" + GENERATED_DOC_BASE;

You probably need to add config path property to the generated doc file name, therefore it should look like:

getConfigValue(quarkus.smallrye-openapi.path)+"quarkus-generated-openapi-doc."
@belyaev-andrey belyaev-andrey added the kind/bug Something isn't working label Jun 7, 2019
machi1990 added a commit to machi1990/quarkus that referenced this issue Jun 10, 2019
machi1990 added a commit to machi1990/quarkus that referenced this issue Jun 10, 2019
machi1990 added a commit to machi1990/quarkus that referenced this issue Jun 10, 2019
patriot1burke added a commit to patriot1burke/quarkus that referenced this issue Jun 14, 2019
root path

docs

fix imports

fix poms and typos

doc suggestions

Add mp rest-client tck configuration

Introduce handling for mp/uri in accordance to spec

Fixes: quarkusio#2795

Remove misleading sentence from Kubernetes / ap4k guide

The guide will updated when dekorateio/dekorate#227
is implemented and the new version included into Quarkus

Implement mock mailer by default on dev/test

fix(quarkusio#2789): fix Jackson version issue

The oder of import in the bom is important, we need to import Jackson first before RESTEasy.
After this, exluding and importing Jackson in the quarkus-smallrye-openapi extention is useless.

Arc - correct circular dependency check to detect self-injection as well, added test.

feat(openapi): Allows OpenAPI path to contain segments e.g /api/openapi/

Fixes quarkusio#2756

Arc - Implement inheritance of scopes for beans.

register reflective classes from bean archive index by providing the index as part of the reflective class build item

Document InjectionPointTransformer.

Arc - register certain CDI components under BuildContext so extensions can use that.
Modify SpringDIProcessor to make use of this.

Subclasses/client proxies - skip delegation if not constructed yet

- resolves quarkusio#2774

Docs - CDI guide - remove unnecessary dummy constructor

feat(agroal): Adds a configuration option to enable datasource metrics

Fixes quarkusio#2820

Quarkus bypasses Nexus and downloads artefacts directly from maven central

Fix title levels in Undertow reference guide

Remove two ArC injection warnings

Update to smallrye-jwt-1.1

Moved common stuff to panache-common-deployment, ported `@GenerateBridge` to non-rx panache

Added two finals

Skip racey TCK test

This is due to eclipse/microprofile-rest-client#203

Undertow 2.0.21.Final

Better error reporting if test resource fails to start

Remove license headers
@gsmet gsmet added this to the 0.17.0 milestone Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants