swagger-api / swagger-api/swagger-ui
Swagger UI not rendering errors
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Q&A (please complete the following information)
- OS: Windows
- Browser: Chrome
- Version: 67.0
- Method of installation: dist assets
- Swagger-UI version: 3.17.x (potentially lower versions are affected as well)
- Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration
API being split over several files
api.yaml
openapi: 3.0.0
info:
version: v1.0
title: Testing
description: Testing
paths:
/testA:
$ref: 'testA.yaml'
/testB:
$ref: 'testB.yaml'
testA.yaml
get:
responses:
200:
description: OK
content:
application/json:
schema:
$ref: 'non_existant.yaml#/schemas/testA'
testB.yaml
get:
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
id:
type: string
Describe the bug you're encountering
The red errors message field is not rendering. The browser console (when using inspect) however still shows the correct error about not being able to GET the the referenced resource (404 Not found).
Interestingly enough, when commenting out the path reference for testB, the error caused by testA is rendered as expected.
Judging from the intial rendering, it seems like the error is temporarily shown, then vanishing. However im not completely sure about that.
Expected behavior
Errors should be rendered.
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
Reproduce the issue using the provided api.yaml, testA.yaml, and testB.yaml with Swagger UI 3.17.x and the dist assets. Compare rendering with both path references present and with testB commented out, while checking the browser console. Done means the red error for the missing referenced resource remains visible when both paths are loaded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100