Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Additional fields for the tag object #4288
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
Additional fields for the tag object #4288
Changes from all commits
f822af7
d3d8633
a055eca
581391a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This interacts with the following text in 3.1.1:
However, that was written to resolve Operation Object
tags
fields to Tag Objects, which means you need to locate a particular OpenAPI Object with Tag Objects under itstags
field. For thisparent
field, if we follow the same guidance, a Tag Object in a referenced document would search for its parent in the entry document.Resolving to the entry document would be the most consistent thing, but not necessarily the most intuitive.
On the one hand, making
parent
only resolve within the current document feels more intuitive. On the other hand, it's also limiting if for some reason you wanted to break tags across multiple OpenAPI Documents in a single OpenAPI Description, and it would make two fields that reference via a tag name behave differently, which is confusing as well.A third option that ends up being more problematic than it seems at first would be to make
parent
take a URI-reference, but since the OpenAPI Object'stags
field is an array, JSON Pointers end up being cryptic and fragile.A fourth option, which would be annoyingly complex, would be to offer both
parent
(resolves to the entry document, since that could be different if the same other document is reference from multiple entry documents) andparentRef
(likeoperationRef
) which could be used with a URI-ref, e.g.#/tags/4
.A fifth option would be to define plain name fragments for tags, e.g "tag.{tagname}" so that URI-references would not have to have a numerical index. But we've avoided doing that sort of thing (although JSON Schema's
$anchor
keyword does it).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm playing around with writing up a
tagRefs
field to allow tags to resolve by URI, and if that works out then maybeparentRef
would be the consistent option.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're in agreement here, although perhaps the wording needs work. An OpenAPI description has the tags defined in its entry document, because there's nowhere else to define them. They don't need to be refs, because like the
info
section,tags
are a document-level thing and I don't see how they can be ref'd in. Operations can use tags that are not defined, but if the tag is defined and has a parent, then I think that parent should be defined too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lornajane I agree with the decision to merge this, and I'll pick up the subtleties elsewhere since I need to do so for
tags
in the Operation Object.This gets tricky when you have multiple OpenAPI Documents (capital D) in your OAD, each of which can have a list of Tag Objects. Similar problems exist for the Security Requirement and Security Scheme Objects.