Closed
Description
Describe the bug
After updating my spring-boot project to 2.6.1
and springdoc-openapi to 1.6.1
, compiling and starting successfully the Docker native container, when trying to access the swagger-ui, the website doesn't open and a 404 is returned.
To Reproduce
- git clone https://github.com/ivangfr/springboot-jsoup-html-parser.git
- cd springboot-jsoup-html-parser
- git checkout project-update
- ./mvnw clean spring-boot:build-image --projects game-score-api -DskipTests
- docker-compose up -d
- docker run --rm --name game-score-api -p 8080:8080 -e MONGODB_HOST=mongodb --network=springboot-jsoup-html-parser_default ivanfranchin/game-score-api:1.0.0
- Open a browser and access: http://localhost:8080/swagger-ui.html
Expected behavior
- The
swagger-ui.html
website should open
Screenshots
Additional context
The http://localhost:8080/v3/api-docs works and returns
{
"openapi":"3.0.1",
"info":{"title":"game-score-api"},
"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],
"tags":[{"name":"Actuator","description":"Monitor and interact","externalDocs":{"description":"Spring Boot Actuator Web API Documentation","url":"https://docs.spring.io/spring-boot/docs/current/actuator-api/html/"}}],
"paths":{
"/api/games":{"get":{"tags":["game-score-controller"],"operationId":"getGameScores","parameters":[{"name":"title","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PageGameScoreResponse"}}}}}}},
"/api/games/{id}":{"get":{"tags":["game-score-controller"],"operationId":"getGameScore","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/GameScoreResponse"}}}}}}},
"/actuator":{"get":{"tags":["Actuator"],"summary":"Actuator root web endpoint","operationId":"links_1","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Link"}}}}}}}}},
"/actuator/metrics":{"get":{"tags":["Actuator"],"summary":"Actuator web endpoint 'metrics'","operationId":"metrics_2","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},
"/actuator/metrics/{requiredMetricName}":{"get":{"tags":["Actuator"],"summary":"Actuator web endpoint 'metrics-requiredMetricName'","operationId":"metrics-requiredMetricName_2","parameters":[{"name":"requiredMetricName","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},
"/actuator/mappings":{"get":{"tags":["Actuator"],"summary":"Actuator web endpoint 'mappings'","operationId":"mappings_2","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},
"/actuator/info":{"get":{"tags":["Actuator"],"summary":"Actuator web endpoint 'info'","operationId":"info_2","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},
"/actuator/health":{"get":{"tags":["Actuator"],"summary":"Actuator web endpoint 'health'","operationId":"health_2","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},
"/actuator/health/**":{"get":{"tags":["Actuator"],"summary":"Actuator web endpoint 'health-path'","operationId":"health-path_2","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},
"/actuator/env":{"get":{"tags":["Actuator"],"summary":"Actuator web endpoint 'env'","operationId":"env_2","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},
"/actuator/env/{toMatch}":{"get":{"tags":["Actuator"],"summary":"Actuator web endpoint 'env-toMatch'","operationId":"env-toMatch_2","parameters":[{"name":"toMatch","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},
"/actuator/beans":{"get":{"tags":["Actuator"],"summary":"Actuator web endpoint 'beans'","operationId":"beans_2","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}}},
"components":{"schemas":{"GameScoreResponse":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"title":{"type":"string"},"score":{"type":"integer","format":"int32"}}},"PageGameScoreResponse":{"type":"object","properties":{"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"},"numberOfElements":{"type":"integer","format":"int32"},"first":{"type":"boolean"},"last":{"type":"boolean"},"sort":{"$ref":"#/components/schemas/Sort"},"size":{"type":"integer","format":"int32"},"content":{"type":"array","items":{"$ref":"#/components/schemas/GameScoreResponse"}},"number":{"type":"integer","format":"int32"},"pageable":{"$ref":"#/components/schemas/Pageable"},"empty":{"type":"boolean"}}},"Pageable":{"type":"object"},"Sort":{"type":"object","properties":{"empty":{"type":"boolean"}}},"Link":{"type":"object","properties":{"href":{"type":"string"},"templated":{"type":"boolean"}}}}}
}