-
Notifications
You must be signed in to change notification settings - Fork 42
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
Custom description for referenced component is sometimes ignored (caching issue in upstream parser?) #131
Comments
Interesting. Had no idea there was a problem like that. The first step would be to dive into the spec parser, and see if the problem is the parsed spec is the issue or if the spec handling in this library is the problem. Update the dependency we are using has a bug, we are working on pulling it out and replacing it. |
FYI @adamsussman, I saw your issue over in the RapiDoc repo. This repo is a fork of RapiDoc from pretty recently, and the issue regarding overwriting of descriptions has been fixed. Actually it was a change we made that enabled libraries such as the OpenAPI Explorer to support custom overrides. For the most part it is a drop in replacement for RapiDoc which gives you a lot of the same look and feel but has a number of these more annoying things fixed. It's not a simple 1:1 switch, but if you do find something not supported it would be great to let us know (hopefully those in a new issue ticket) |
Thank you @wparad, will take a look! |
This is a bit hard to describe, and I believe the actual bug here is in an upstream dependency, but I'm not sure where exactly to look.
When using
$ref
in a schema, it's possible to include adescription
both in the shared component being referenced (e.g. describing a type), and in the property itself (e.g. describing its usage in context). The relevant specs leave it up to implementations what to do here: show both descriptions, or over-write one with the other.The parser used in OpenAPI Explorer appears to prefer the "local" description, discarding the one from the shared reference. However, it sometimes fails to do so.
Playing around with an example, this appears to be some kind of caching bug: if you always supply a description when using a particular component, that description is displayed. However, if you have previously referenced the component without overwriting its description, further custom descriptions are ignored.
For an example, load this OpenAPI description file with OpenAPI Explorer, and observe:
nested-one-custom
displays its custom description - that component has only been used with a custom description, so is not cached(?)nested-two-custom
ignores the custom description - somehow the top-leveltwo-default
populated a cache(?)double-nested-three-custom
ignores the custom description - becausenested-three-default
populated the cache(?)double-nested-four-custom
ignores the custom description - becausenested-four-default
populated the cache(?)The text was updated successfully, but these errors were encountered: