Replies: 8 comments 22 replies
-
Nice proposal!
|
Beta Was this translation helpful? Give feedback.
-
@lornajane thanks for writing this up! I think this is an interesting complement to #30 – that discussion is something of a top-down approach starting from design concerns where tags could be part of the solution, while this proposal is bottom-up, proposing a more feature-rich tagging system. I brought up in the other discussion that we seem to have some disconnect between features/outcomes for documentation vs SDKs (and other code generation). So my question here is: Should tags be a purely documentation-oriented feature, or should they support all generative use cases? Or are there potentially two mechanisms that we need in place of the current tags, which as you note are typically used poorly anyway. Getting into @baywet 's comment a bit, and thinking about #30's questioning of hierarchy, would a more general "related" field, rather than a strict "parent" field, be more useful? I'm a strong proponent of embracing the graph-like reality of APIs. Strict hierarchical trees only work well with a subset of modeling problems. For example, "accounting" and "legal" do not have parent-child relationships with "collection" (or with each other). |
Beta Was this translation helpful? Give feedback.
-
What purposes tags do fit? Honest question. I only seen them used for grouping operations in UI or in a client library, and it doesn't seem like the right purpose. |
Beta Was this translation helpful? Give feedback.
-
It's correct that this is how tags are predominantly used. However, I'm wondering if we've just always used the wrong capability! I've written converters to turn OpenAPI into Postman collections and vice-versa. It's always felt off and been lossy. Tags do not make good organization hierarchy pointers. I would actually propose going in the opposite direction: lean into tagging, allow tags to have an optional |
Beta Was this translation helpful? Give feedback.
-
We use tags for grouping operations in the (interactive) API documentation. Tag values are typically the "resource type" that the operation acts on or returns, and operations that "follow a relationship" are tagged with both the source and target resource type, see for example https://api.sap.com/api/CE_BANK_0003/resource/Bank.
|
Beta Was this translation helpful? Give feedback.
-
I like the idea of hierarchical tags, but (This assumes each tag can have only one parent tag.) tags:
- name: deprecated
type: internal
summary: Deprecated
description: This operation has been deprecated and will be removed in the future. Avoid using items with this tag.
- name: shop
type: nav
summary: Order Online
description: Operations relating to the retail operations behind the [online shopping site](https://example.com/shopping).
subtags: # or 'children', or similar
- name: products
type: nav
summary: Products
description: View and manage the product catalog.
- name: orders
type: nav
summary: Online Orders
description: Place, fulfil and invoice orders for the online shop. |
Beta Was this translation helpful? Give feedback.
-
@lornajane 1st and foremost thanks for sharing your ideas in the form of this proposal. Having grokked everyone's opinion here (to get some perspective), are you then proposing a taxonomic approach to docgen and codegen ? I think this is a good opportunity to go beyond the current status quo of how tags have been traditionally used (misused ? - although to be honest like @ralfhandl I just have the same resource-oriented use case, which then is leveraged by whatever tool works for me). I do understand that in your space you have deeper use cases. I am trying to get there. Looking at your example: |
Beta Was this translation helpful? Give feedback.
-
After discussion in the SIG meeting (Moonwalk) today, there are some agreements on what we should do next.
|
Beta Was this translation helpful? Give feedback.
-
Tags in OpenAPI 3.x are fit for many purposes, sadly they're not really fit for the purposes that they actually get used for. Having seen a bunch of discussions about how to work around the tags situation, and a number of other feature requests that would be solved with tags if we were not already using them incorrectly, I'd like to propose that we level up our tags game for the next generation.
Tags are mostly used in a one-tag-per-operation format, to group operations for display in reference documentation. This is very limiting because:
x-tagGroups
is a good example - and there's a very active open issue on OpenAPI as wellx-internal
as a tag-alike since if we could add arbitrary tags to endpoints, it could be tagged in that fashionProposed changes
I think we can achieve these changes by enriching the existing top-level tags declaration to add more metadata, that the various tools can use as they please.
summary
alongsidename
anddescription
. In keeping with our existing practices: name is the identifier, summary is the short display content, and description is available in contexts where more information is appropriate.parent
field is added to support a hierarchy without adding either separators or a new data type. Your tag can belong to another tag.kind
field to explain which family of tags this tag belongs to (previously proposed astype
). We'd expecting these to benav
,badge
,internal
and probably some other things that other tooling types would find useful. I'm very open-minded on the values we should use here, and it definitely needs to be extensible, but offering some suggested values that would get tooling vendors to be on the same page for the use cases we already know about is my goal. And leaving this open for all the other use cases I haven't thought of - and making it clear that more use cases are expected and tools should respect that. (update: we'll use a registry rather than set these out in the spec itself)Example
I work for a tools vendor, and I originally started writing this as an internal feature proposal - but I realised that there's a lot of other tools with the same discussions happening, so I'm proposing it here.
Beta Was this translation helpful? Give feedback.
All reactions