-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
feat: add 'values' field to Tag Object #744
Conversation
Examples added. |
Kudos, SonarCloud Quality Gate passed!
|
|
||
```json | ||
{ | ||
"name": "user", | ||
"description": "User-related messages" |
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.
For some reason, there were tabs here.
@@ -1351,15 +1351,18 @@ Field Name | Type | Description | |||
<a name="tagObjectName"></a>name | `string` | **Required.** The name of the tag. | |||
<a name="tagObjectDescription"></a>description | `string` | A short description for the tag. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation. | |||
<a name="tagObjectExternalDocs"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this tag. | |||
<a name="tagObjectValues"></a>values | [`string`] | The value(s) for the tag. |
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 not sure I like having values
inside the global Tag object. We only verified this has a use case on servers but how is it going to affect the rest of the spec where Tag is used? Should we have another kind of Tag object just for servers?
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.
For other objects it will work the same way as for servers, just the tags will be treated as "metadata", with which you will be able to filter certain elements in the UI or via the CLI (of course we will have to implement this). Currently a tag only has a key (name field) but you can't define certain more specific values for that (we don't want use delimeter or something like). This can be compared to labels
in Kubernetes where labels are used to filter/create relationships between resources - https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
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.
Btw, I'm not sure if we should call it values
or rather value
in singular, even we allow having multiple. It is just a feeling I guess but the plural sounds weird to me in this case.
I'm not sure what I think about this. I think my hesitation mainly comes from the fact that OpenAPI doesn't do this. I know we're not beholden to what OAI do, and consistency for the sake of consistency isn't smart. But... tagging isn't a uniquely-event-centric thing, so I'm hesitant about diverging on things where it isn't specifically in service of asynchronous issues. Like I say I'm not sure. If OAI didn't exist, purely looking at this idea in isolation, I'd probably be more in favour. |
I understand your point. In fact, I didn't pay attention to how OAI does (now I realize we just ported it literally). As @magicmatatjahu mentioned, this pattern of key/value for tags is common in other solutions such as Kubernetes, where you can implement selectors that solve most of the issues of grouping and filtering objects (workloads in their case). I see it as a UX improvement that allows more extensibility, even though not mandatory for any new feature yet afaik. |
Yeah, that's a great point @dalelane. @smoya what about introducing the concept of |
I wanted to make the same suggestion yesterday, however, those are the points that stopped me to do it:
For the 1st and 2nd points, I would love to ask @dalelane about the terminology Are we at the starting point again now?😅 |
Yeah, I actually searched for the difference between label and tag when replying above so fair point.
Pretty much yeah 😅 But that's fine 😄 So, my concern with changing the Tag Object is that people would not be able to reuse their definitions between OpenAPI and AsyncAPI. Actually, if we make the So my proposal is that we ping the OpenAPI folks and see if they would be happy to add the |
added comment here #654 (comment) |
Part of #654
This materializes an idea @maciej Urbańczyk brought on #654.
It is a RFC-0, so it can be treated as what it is. A suggestion.
This PR adds a new
values
field toTag Object
to declare a list of plain strings as values.This is needed since the current Tag Object only defines a
name
that can be used as an identifier of the tag, but there is no other field for declaring values. Without this change, users are forced to compose tag names, i.e.name: "env:prod"
or for declaring multiple values:name: "owner:platform,product
However, this penalize UX (and tooling one) since no format standard will be in place. Especially hard when displaying those tags in documentation, or when filtering by any of those tags. For example, filtering by the owner tag above.
Related issue(s):
#654