✨ support defining a dimension field as multi-valued #126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @azaurus1, I hope you're doing well!
As we discussed on azaurus1/terraform-provider-pinot#56, this pull request is to add support for the
singleValueField
property. It requires a boolean to indicate if the field is single-valued or multi-valued.The only issue I encountered was regarding how the
omitempty
option works. It states that the field should be excluded from the encoding if it has an empty value, defined asfalse
,0
, anil
pointer, anil
interface value, or any empty array, slice, map, or string.When both
NotNull
andSingleValueField
are set to false, they are omitted.To address this issue, I've replaced it with a boolean pointer as this issue has been extensively debated and this seems to be the simpler workaround. Alternatively, we could use a different JSON serializer. There's also a proposal for golang to support this natively, which is almost ten years old. You can find it here.