microprofile-extensions / openapi-ext

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

Is it possibel to change the API path? #51

Closed rsoika closed 3 weeks ago

rsoika commented 1 month ago

When I am using the latest version 2.0.0 of openapi-ui I have the problem, that the path to my API is not correctly displayed.

My main application config is defined like this:

@ApplicationPath("/api")
public class ImixsApplication extends Application {

}

so all my Rest API resources are located under /api/....

But the swagger ui exentension shows all Rest Resoruces at the root level "/"
This is also wrong in the openapi file generated by Eclipse Microprofile. I am using Wildfly 27

How can I change this?

phillip-kruger commented 1 month ago

try setting the config openapi.ui.contextRoot=/api

rsoika commented 3 weeks ago

The reason for my problem was that I named the packages to be scanned in my microprofile-config.properties file

# packages
mp.openapi.scan.packages=org.imixs.microservice,org.imixs.workflow.jaxrs,org.imixs.workflow.xml

But I left the package with the jakarta.ws.rs.core.Application defining the application path with the annotation @ApplicationPath("/api")

As soon as I added this additional path (or removed the parameter completely) everything works perfect!