Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion VariantShredding.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ The list `element` must be a required group.
The `element` group can contain `value` and `typed_value` fields.
The element's `value` field stores the element as Variant-encoded `binary` when the `typed_value` is not present or cannot represent it.
The `typed_value` field may be omitted when not shredding elements as a specific type.
When `typed_value` is omitted, `value` must be `required`.
The `value` field may be omitted when shredding elements as a specific type.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is fine to say that one of the fields must be present and that value can be omitted (though it is not necessary).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we also clarify whether they can/should be optional vs required or either?

Copy link
Copy Markdown
Contributor Author

@aihuaxu aihuaxu Aug 15, 2025

Choose a reason for hiding this comment

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

Thanks for reviewing. In line 68, we have the statement

Both value and typed_value are optional fields used together to encode a single value.

to serve the overall value shredding. I think we don't need to mention in different places.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That means the test cases which test with the fields being required should also get notes that they are invalid based on the spec?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think we have such case in the tests. The case we have is: the group should be required but it's passed in as optional. For example:

required group event_type {
      optional binary value;
      optional binary typed_value (STRING);
    }

However, at least one of the two fields must be present.

For example, a `tags` Variant may be shredded as a list of strings using the following definition:
```
Expand Down