-
Notifications
You must be signed in to change notification settings - Fork 47
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
3 ways to reference reusable components #181
Comments
@RomanHotsiy the 3 options have been grating a little with me too. I'm already thinking of consolidating I can bite the bullet and rename Removing the keyword clash with JSON Schema's $ref is indeed the primary motivation. There's a whole world of pain caused by this as well as real inabilities to adequately resolve references based on lack of clarity on how to deal with different JSON Schema versions in referenced fragments as well as dealing with the direction of resolution and upgrading or downgrading accordingly. It's completely left up to an implementor to decide which results in interoperability issues. The same mantra of moving away from the current OAS Reference Object (which contains the keyword clash) is also being proposed for the next version of OAS. |
@RomanHotsiy - hopefully #182 simplifies the situation |
@frankkilcommins this makes it better for sure! Thanks. Yet I'm still confused why we have to invent a new way of reuse just for this spec. Whatever reusability mechanism is planned for Moonwalk it seems to be different form this. So instead of a single reusability mechanism ($ref) we're inventing new ones for each spec. I understand this is part of a broader discussion about |
@RomanHotsiy the Moonwalk discussion isn't settled yet, and I'm paying attention to how this works out as we try to figure that out.
Because we don't have a single re-usability mechanism. We have at least 9 across 3.0 and 3.1 (6 in 3.0, 8 in 3.1, 5 overlapping):
There are also numerous features that have implicit correlations - path or server template variables names, EDIT: And the way Server Objects get looked up across Operation, Path Item, and the root Object, which, like the component name connections, becomes ambiguous if you reference a complete document that has its own Components Object and/or root-level Servers Object). LATER EDIT: Oh and the way |
This is not even getting into the fact that some of those linkages that use URI-references resolve as URLs (strictly location-based) and some in 3.1 resolve as URIs (identifiers that need not correlate to location). |
Plus, tooling support for
|
After reviewing the last draft of the spec I noticed there are 3 different ways to reference reusable components:
$ref
for inputsWe believe that the end users (authors) will be constantly confused about which to use in which context.
What problem do we solve with those 3 ways of referencing and why we can't use
$ref
s for all of those (which users are familiar with as well as tooling support).I believe it has to do with $ref semantics in context of JSON schema.
I believe while it may improve the experience for tooling authors it makes it much worse for the end users.
But I'm not even sure if it makes it easier for the tooling authors as now we have to deal with more error messages and validations.
On a separate note I'm not clear why the Reusable objects has this specific structure:
The moment that I'm unclear about is why the field is called
name
while the expression does not resolve to the name or anything like name?The text was updated successfully, but these errors were encountered: