Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error messages display on screen briefly before disappearing #5214

Closed
jimcullenaus opened this issue Mar 4, 2019 · 4 comments
Closed

Error messages display on screen briefly before disappearing #5214

jimcullenaus opened this issue Mar 4, 2019 · 4 comments

Comments

@jimcullenaus
Copy link

Q&A (please complete the following information)

  • OS: Ubuntu 18.04.1 LTS
  • Browser: Chrome 72.0.3626.81, Firefox 65.0.1
  • Swagger-UI version: 3.21.0, 3.20.6
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Any invalid OpenAPI configuration.

One common example is not including query parameters under a schema object in a 3.0 config, and instead simply declaring their type directly under the parameter.

Describe the bug you're encountering

When loading the swagger ui, an error briefly appears at the top of the page, for a small fraction of a second. It then immediately disappears.

No messages are left in the console log.

To reproduce...

Steps to reproduce the behavior:

  1. Create an OpenAPI spec with some errors in it.
  2. Load that spec using the swagger-ui
  3. Observe error messages flash at the top of the page and disappear

Expected behavior

Errors should remain at the top of the page until and unless manually dismissed.

Errors should also ideally be added to the console log.

Screenshots

Screenshots taken at various stages in the loading of the page.

vlcsnap-2019-03-04-10h24m51s609
vlcsnap-2019-03-04-10h25m05s537
vlcsnap-2019-03-04-10h25m16s546

@shockey
Copy link
Contributor

shockey commented Mar 5, 2019

Hi @jimcullenaus, thanks for filing this.

You see no difference in behavior between 3.21.0 and 3.20.6 with your definition? I ask because we specifically made a change last week that should persist resolver error messages (#5193).

Any invalid OpenAPI configuration.

One common example is not including query parameters under a schema object in a 3.0 config, and instead simply declaring their type directly under the parameter.

Swagger UI doesn't generate error messages for invalid definitions - only for network and resolver problems, generally. Are you referring to the embedded Swagger UI found within Swagger Editor?

@jimcullenaus
Copy link
Author

You should be able to see the errors in the screenshots above. Faded, because the messages appear so briefly that the screen recording software I used couldn't grab them properly. The errors I have been able to capture do all seem to be resolver errors, however.

From what I could tell, yes, the problem occurs in both 3.21.0 and 3.20.6. Unfortunately the only way I could find to tell what version is actually running was from code, not from the browser, so it is not impossible that somehow the version running was not the version specified in the package.json. However everything I can see suggests that the version was updated and that the error still occurred.

@shockey
Copy link
Contributor

shockey commented Mar 6, 2019

Each Swagger UI 3x version comes with a version identifier baked into it - see the version detection documentation for more information. Long story short, checking window.versions.swaggerUi in your console will give you the exact version present on the page.

If you're able to get back to your original example, that may help confirm your assumptions 😄

@jimcullenaus
Copy link
Author

Hmm, it does indeed seem to be running the older version still. Not sure why. I have been unable to get it to upgrade to the latest version whatever I try. However, it does confirm that I can't confirm the issue occurs even on 3.21.0, so unless there's more to add, I'll close off this ticket.

@lock lock bot locked and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants