Hi Aishwarya,

This is possible by providing SwaggerUiConfig while configuring Swagger2Feature 
[1], which is available
from 3.2.7 (minor upgrade may be needed in your case), something like that:

final Swagger2Feature feature = new Swagger2Feature();
feature.setSwaggerUiConfig(new 
SwaggerUiConfig().url("/rest/api/content/v1/swagger.json"));

The unclear part is that you have multiple Swagger contracts, you may need to 
pick one as the "default".
Thank you.

[1] 
http://cxf.apache.org/docs/swagger2feature.html#Swagger2Feature-ConfiguringSwaggerUI(3.2.7+)

Best Regards,
    Andriy Redko

Thursday, April 11, 2019, 3:28:03 AM, you wrote:

asgc> Hi Team,

asgc> I have developed a CXF based Swagger page. I am able to access my CXF 
Endpoints in Swagger under the following URL:
asgc>     http://<host>:<port>/cxf/services

asgc> We are able to access the Swagger page for each CXF endpoint at their 
respective endpoint urls like - /api-docs?url=/rest/api/content/v1/swagger.json
asgc> /api-docs?url=/rest/api/commercial/v1/swagger.json

asgc> But when I truncate everything after /api-docs? in the above url path, 
the Swagger page gets forwarded to the default Petstore's Swagger page.

asgc> How can I configure the swagger.json globally on Swagger2Feature so that 
it'll always forward only to my App's Swagger page?

asgc> Note: We are not using openapi implementation of CXF. We are using 
cxf-service-description-swagger version 3.2.6.
asgc> We cannot move to OpenAPI since we generate Swagger from XSDs and WADLs.

asgc> Thanks,
asgc> Aishwarya S 

Reply via email to