[
https://issues.apache.org/jira/browse/CXF-9155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18014779#comment-18014779
]
Zhiying Yan commented on CXF-9155:
----------------------------------
> And we do have samples/jax_rs/spring_boot in CXF distribution kit which you
> can access the swagger-ui from url like
>http://localhost:8080/services/helloservice/api-docs?url=/services/helloservice/openapi.json
>Is this what you are looking for?
Thanks for the sample. I checked description_openapi_v3,
description_openapi_v3_spring, and description_openapi_v3_web before, but
didn't notice spring_boot because it does not have openapi_v3 in the name.
I tested it and realized that I had a misconception regarding the
SwaggerUiConfig().url("/services/openapi.json").
It appears that this value would only influences explore value in swagger UI.
Am I correct in understanding this?
!explore-url.png!
if the openapi json is available in
http://localhost:8080/services/helloservice/openapi.json, then I need to set as
SwaggerUiConfig().url("/services/helloservice/openapi.json").
but why do I have to set the queryConfigEnabled as false, or it will show the
PetStore in swagger UI?
{code:java}
openApiFeature.setSwaggerUiConfig(
new SwaggerUiConfig()
.url("/services/helloservice/openapi.json")
.queryConfigEnabled(true));
{code}
The it will show PetStore in swagger ui.
!Petstore.png!
> OpenApiFeature can not set Server or SwaggerUiConfig.url
> --------------------------------------------------------
>
> Key: CXF-9155
> URL: https://issues.apache.org/jira/browse/CXF-9155
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 4.1.0
> Reporter: Zhiying Yan
> Assignee: Freeman Yue Fang
> Priority: Minor
> Attachments: Petstore.png, cxf-openapifeature-test.zip,
> explore-url.png, server-in-swagger-ui.png
>
>
> I have _JAXRSServerFactoryBean_ and
> _setAddress("http://0.0.0.0:8080/services");_
> I'd like to customize the execute server in swagger-ui as _/services_, but
> this is not working as expected.
> Also the following section does not work.
> {code:java}
> openApiFeature.setSwaggerUiConfig(new
> org.apache.cxf.jaxrs.swagger.ui.SwaggerUiConfig()
>
> .url("/api/hello/api-docs?url=/services/api/hello/openapi.json"));
> {code}
> Please help to check!
> Thanks!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)