swagger-api / swagger-api/swagger-ui
Swagger-ui doesnt work with yaml file.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
- OS: [WINDOWS 10]
- Browser: [chrome, safari]
- docker-compose
- Swagger-UI version: latest
- Swagger/OpenAPI version: latest
Im trying to start swagger-ui on docker using docker-compose
i have a custom yaml file that i need to load.
i converted my yaml file into a json
swagger-ui:
image: swaggerapi/swagger-ui
container_name: "swagger-ui"
ports:
- "8888:8080"
volumes:
- ./swagger/swagger.json:/swagger.json
environment:
SWAGGER_JSON: /swagger.json
# API_URL: ""
networks:
- xdsjdh
and it works perfectly, but if i try with yaml file
swagger-ui:
image: swaggerapi/swagger-ui
container_name: "swagger-ui"
ports:
- "8888:8080"
volumes:
- ./swagger/swagger.yaml:/swagger.yaml
environment:
SWAGGER_JSON: /swagger.yaml
# API_URL: ""
networks:
- xdsjdh
when i look swagger ui page on ./swagger.yaml
i got a error message "failed to fetch /swagger.yaml"
all files are in the same directory
swagger.json and swagger.yaml
Thanks in advance.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided docker-compose configuration, mounting swagger.yaml and setting SWAGGER_JSON to /swagger.yaml. Compare the YAML and JSON cases in Swagger UI and verify that the mounted YAML specification loads successfully without the “failed to fetch /swagger.yaml” error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100