microprofile-extensions / openapi-ext

Some extensions for MicroProfile OpenAPI
Apache License 2.0
22 stars 13 forks source link

Allow service of static context via JAX-RS when Context root and Appl… #9

Closed phillip-kruger closed 4 years ago

phillip-kruger commented 4 years ago

…ication path is /

Signed-off-by:Phillip Kruger phillip.kruger@gmail.com

phillip-kruger commented 4 years ago

@rhuan080 please let me know what you think.

Lars5678 commented 4 years ago

Hi, I came across the same problem. How is the status? What is the preferred way? It would be nice if http: // localhost: 8080/open-ui is possible.

phillip-kruger commented 4 years ago

Hi @LarsBrenker - if you build from source this should now work. I'll have to release to make this available in maven central

Lars5678 commented 4 years ago

Hi @phillip-kruger . Thanks for your reply. Is a release planned in the near future?

phillip-kruger commented 4 years ago

I released v 1.0.3 that contain the changes above. It will take a few hours before it reflects in maven central.

Lars5678 commented 4 years ago

Super. Now it works with contextroot / and @javax.ws.rs.ApplicationPath("/").

The problem now I have, however, is that the Swagger UI displays special characters in the path. Neither the Payara logs nor /openapi indicate this. It must be due to display errors in the UI. As soon as I specify a contextpath or applicationpath, the UI correctly displays the path. But that's exactly what I do not want. Technically, everything is ok, but not in the GUI

Payara Logs:

'deployments' REST Endpoints:
GET /application.wadl
GET /openapi-ui
GET /openapi-ui/favicon-{size}.png
GET /openapi-ui/index.html
GET /openapi-ui/logo.png
GET /openapi-ui/style.css
GET /openapi/
GET /openapi/application.wadl
GET /user/v1/find/{id}
GET /user/v2/find
GET /{path: webjars/.*}

/openapi endpoint

/user/v1/find/{id}:
    get:
      tags:
      - user
      summary: Find user by id.

grafik

phillip-kruger commented 4 years ago

That is a weird one. Do you have an example that recreate this error that I can look at ?

Lars5678 commented 4 years ago

If I take the base image of Payara it works. It uses openjdk: 8-jdk-alpine . We use an own image with Corretto with Debian. Maybe a codepage problem. Or does Swagger need to be configured?

phillip-kruger commented 4 years ago

Could be. Some encoding issue. I do not think Swagger needs to be configured.

Lars5678 commented 4 years ago

Could be. Some encoding issue. I do not think Swagger needs to be configured.

Yes. -Dfile-encoding=UTF-8

Now it works. Thanks a lot for v 1.0.3

phillip-kruger commented 4 years ago

Great !! Pleasure :)