When initially loading below example, the spec is detected as 3.0, but after calling SwaggerUIBundle a second time, the spec is detected as 2.0 as seen by the OAS3 badge disappearing and the authorization functionality not working. I observe this bug in a react application where it shows on every component mount after the first one. I tried with both swagger-ui and swagger-ui-dist, both seem affected.
The spec should be detected as OAS3 on subsequent calls to SwaggerUI or SwaggerUIBundle.
@silverwind, you say you're doing this in a React application? What React version does your application use?
React 16.5.0, but I think this should be reproducible in plain JS too.
Plain JS repro: https://jsfiddle.net/90po3sL5/12/
With one call to SwaggerUIBundle it renders v3, with two calls it renders as v2.
Indeed, this is a bug on our side. Thanks for the fiddle!
This appears to be related to https://github.com/swagger-api/swagger-ui/issues/4468, which we didn't correctly interpret at the time.
Yes, appears @brudnyhenry is spot on there. I can reproduce in 3.6.1, but not in 3.6.0. Suspected commit was https://github.com/swagger-api/swagger-ui/commit/dc9e5ad9cd18333db91a5e7a97bf00a70fcecc52.
I agree - my apologies @brudnyhenry, we took the wrong direction with your ticket!
This has been highly prioritized, so it should be fixed soon 馃槃
Spent some time on this over the week - no resolution yet.
Current line of thought is that object inheritance is affecting the plugin source (possibly the delete statements in dc9e5ad9), so that we get a different result the second time around.
Most helpful comment
I agree - my apologies @brudnyhenry, we took the wrong direction with your ticket!
This has been highly prioritized, so it should be fixed soon 馃槃