-
Notifications
You must be signed in to change notification settings - Fork 899
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
Support nested Attribute values (#376) #596
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -376,8 +376,9 @@ An `Attribute` is defined by the following properties: | |
- (Required) The attribute key, which MUST be a non-`null` and non-empty string. | ||
- (Required) The attribute value, which is either: | ||
- A primitive type: string, boolean or numeric. | ||
- An array of primitive type values. The array MUST be homogeneous, | ||
i.e. it MUST NOT contain values of different types. | ||
- A child Attribute | ||
- An array of primitive type values or children Attributes. The array MUST be | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The array restrictions (no nested arrays, no different types) were made to ease implementation and APIs in statically typed languages. This PR would mostly negate this, because by using an array of attributes you could have different values inside these attributes, including arrays. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would argue that the current homogeneous convention is made because some languages can't accept array with different member types. If we consider the whole Programming-wise IMHO, |
||
homogeneous, i.e. it MUST NOT contain values of different types. | ||
|
||
The Span interface MUST provide: | ||
|
||
|
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.
A single child attribute? That does not sound useful. So instead of Attribute(3), I could have Attribute(Attribute(Attribute(3)))? That's probably not what you meant to say.
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.
Ah, I think I understand: The attribute does include the key! Then I would allow the child attribute only in the array because
Attribute(key=foo, value=Attribute(key=bar, value=42))
sounds useless.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.
Appreciate the feedback! Yeah that makes sense. Even if some use cases need a single child attribute, it can still be placed in the array. I'll updating the PR.