Hello,

I publish some jax-rs endpoints with CXF xml blueprints and I generate openapi 
info through the org.apache.cxf.jaxrs.openapi.OpenApiFeature feature. Then I 
install the swagger-ui as a bundle through the war feature in Karaf. My problem 
is this:

I have the the application server base uri where the swagger-ui is published
I have the common context for CXF endpoints as configured through the 
org.apache.cxf.servlet.context property
Finally I have the url of the endpoint I’m documenting with openapi as defined 
in its blueprint jaxrs:server element

To document the actual path of my endpoints I have to use the @Server(url = 
"/cxf-context/api-server-url") annotation where I hard-wire and duplicate the 
content of org.apache.cxf.servlet.context property (cxf-context in this 
example) and the jaxrs:server address as already specified in blueprint 
(api-server-url in the example).

Is there a way to avoid this? Something like enabling config admin to resolve 
variables inside openapi annotation values?

As an alternative, I’m thinking to develop a jax-rs filter to resolve variables 
inside the openapi.json/openapi.yaml responses, pulling out the actual values 
from config-admin. Is this a good approach? Is there any example I could use as 
a starting point to develop such a response filter?

Thank you,
Matteo


Reply via email to