[ https://issues.apache.org/jira/browse/CXF-9069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17890475#comment-17890475 ]
Andriy Redko commented on CXF-9069: ----------------------------------- [~this.romanov] please provide `@OpenAPIDefinition` annotation with servers component defined [1], since nor CXF, nor Swagger are aware of the server name you would like to use. [1] https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-annotations/src/main/java/io/swagger/v3/oas/annotations/OpenAPIDefinition.java > bad url in swagger servers > -------------------------- > > Key: CXF-9069 > URL: https://issues.apache.org/jira/browse/CXF-9069 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 4.0.5 > Reporter: Dmitry > Priority: Major > Attachments: image-2024-10-17-10-11-59-161.png > > > Good afternoon! > I use cxf-rt-rs-service-description-openapi-v3 > and cxf-spring-boot-autoconfigure > When I run my app localy - server in swagger its > ["http://127.0.0.1:8081"|http://127.0.0.1:18081/] > and its work good. > but when I run it in docker - server become "http://upstream-api" instead of > domen name and all endpoints in swagger are dont work ("TypeError: > NetworkError when attempting to fetch resource.") > This problem was not there when I used cxf-rt-rs-service-description-swagger. > What I do wrong? I should change something in app configuration or in > container/infrastructure? > Devops tells me that problem is in swagger settings. > Thank for your time! > !image-2024-10-17-10-11-59-161.png! > My SwaggerConfig: > @[~bean] > {color:#cf8e6d}public {color}OpenApiFeature > {color:#56a8f5}openApiFeature{color}() { > OpenApiFeature openApi = {color:#cf8e6d}new {color}OpenApiFeature(); > openApi.setVersion({color:#c77dbb}version{color}); > openApi.setPrettyPrint({color:#cf8e6d}true{color}); > openApi.setContactEmail({color:#c77dbb}email{color}); > openApi.setDescription({color:#c77dbb}description{color}); > openApi.setTitle({color:#c77dbb}productTitle{color}); > openApi.setSupportSwaggerUi({color:#cf8e6d}true{color}); > openApi.setSwaggerUiConfig({color:#cf8e6d}new > {color}SwaggerUiConfig().configUrl({color:#6aab73}"/openapi.json"{color})); > {color:#cf8e6d}return {color}openApi; > } -- This message was sent by Atlassian Jira (v8.20.10#820010)