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

Proposal for referencing Tag Objects with URIs. #4480

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

handrews
Copy link
Member

This proposal replaces draft PR #4390 based on today's TDC call.

  • schema changes are included in this pull request
  • schema changes are needed for this pull request but not done yet
  • no schema changes are needed for this pull request

@handrews handrews added the metadata tags, info, license, contact, markdown usage, etc. label Mar 20, 2025
@handrews handrews added this to the v3.2.0 milestone Mar 20, 2025
@handrews handrews marked this pull request as ready for review March 20, 2025 20:06
@handrews handrews requested review from a team as code owners March 20, 2025 20:06
@lornajane
Copy link
Contributor

Thanks for putting this together, good structure and good starting point for getting input on the idea!

ralfhandl
ralfhandl previously approved these changes Mar 21, 2025
@ralfhandl ralfhandl requested a review from a team March 21, 2025 13:10
Copy link
Contributor

@lornajane lornajane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not in favour of these additions for the 3.x branch. I wish that we'd implemented tags differently in the first place, and I'm sure that all the constructive discussion around the tags feature will help us a lot in future major releases.

I believe that the limitations of the current tag situation can be overcome with helper tooling and that this change (while solving a narrow but valid use case) adds complexity to the specification that is unnecessary and does not benefit the majority of users. As custodians of a widely-used standard, we have a responsibility to maintain something that is appropriate for its audience, and we should be "reluctant" in all our changes unless we see that they are really needed.

I propose that users would be equally well served by leaving the requirement to resolve tags from the entry document. Organisations can either maintain an extensive list of tags in all OpenAPI documents, and then remove any that aren't used before publishing (tooling exists for this use case), or alternatively if a tool wants to include tags found in the wider context of referenced OpenAPI documents by adding them to the top-level tags array during processing, that would work well too.

The tags array is a list of strings. It isn't an ID like the Operation uses, and it's not a named entry like the security schemes, so it is appropriate to approach the limitations of it differently. My proposal is to offer some advice or documentation on approaching this problem, but not to bring it in scope of the specification for 3.x since other options are available.

(I've marked this as "request changes" so that my review isn't missed/ignored - but please feel free to dismiss it if we reach consensus as a group that this proposal should go forward anyway).

@lornajane lornajane requested a review from a team March 23, 2025 19:32
@ralfhandl ralfhandl dismissed their stale review March 24, 2025 09:58

Convinced by @lornajane's arguments I remove my approval

@handrews
Copy link
Member Author

handrews commented Mar 26, 2025

@lornajane @ralfhandl I have updated the proposal to document the rejected status so we can point to the file in the repo (and not an old PR) in issues where the feature is requested.

@ralfhandl ralfhandl requested review from lornajane and a team March 27, 2025 08:12
@lornajane
Copy link
Contributor

I'd like to leave this open a week or two longer if that's okay - a proposal isn't a minor thing and I don't want to move so quickly we don't hear input from others if they want to give it.

However, in [3.0.4](https://spec.openapis.org/oas/v3.0.4#resolving-implicit-connections) and [3.1.1](https://spec.openapis.org/oas/v3.1.1#resolving-implicit-connections) we RECOMMEND (== SHOULD) that tag names are resolved to Tag Objects in the _entry document_.
This means that there is no way to resolve them from the current document, which is the mirror image of the problem as that encountered by @SandroG.

In today's TDC call, @lornajane stated that she expects tag names to be resolved from the entry document, and @kevinswiber expressed doubt that anyone implements anything else (sadly @SandroG does not mention their tool, which presumably resolves from the current document or else they would not have explained the issue in this way).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry I missed this discussion in the TDC call. I can easily imagine scenarios where tags should be resolved to the current document. Consider an API that is actually implemented as a collection of microservices that each implement the CRUD operations for one or more resources. The API description might be structured as an entry document that $ref's in groups of path items from separate documents for each microservice. Now suppose we want one tag per resource -- these tags would naturally be defined in the document for a micro service and not the entry document.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikekistler yes, that's exactly the sort of scenario I feel we should support using the same mechanisms we use for everything else.

I'm a little curious why you see this scenario but reject solving it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agreed with rejecting solving this in 3.2. I think we should solve this in 4.0.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikekistler got it. yeah in 4.0 we need to have just one mechanism. Or at least one mechanism per use case (e.g. one magic "look in the entry document" mechanism, and one explicit "look exactly where I say" mechanism). Note that in JSON Schema, $dynamicRef is the (more flexible but also more complex) equivalent of the magic entry document mechanism.

Copy link
Contributor

@mikekistler mikekistler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I concur with rejecting this for 3.x. I think the rationale given is sound.

@handrews
Copy link
Member Author

@lornajane That's fine with me, if somehow things change it's still valuable to document your rationale- under "alternatives" if we end up finding a version of this to accept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metadata tags, info, license, contact, markdown usage, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants