sdk-go
sdk-go copied to clipboard
"if present" validation
We are getting this issue reported against Event Grid: https://twitter.com/jonatasbaldin/status/1256512556782452737?s=20
"currently, the cloudschema field is present but empty, and, per the spec: "If present, MUST be a non-empty URI""
My stance is that a "null" value, i.e. the simple presence of the attribute name in a dynamic collection, does not indicate "present" in the sense of the rules we have for attributes. "null" is "no value" and therefore not present.
We actually had a discussion about this on Slack almost a year ago: https://cloud-native.slack.com/archives/C9DB5ABAA/p1558713174012100
@deissnerk the Slack app does not show replies on your question there.
@clemensv It was not a thread, but @duglin replied the next day in the channel, and @duglin, you and me discussed. We basically concluded that null values should be interpreted as if the value was not present. Not all protocol bindings / formats support null values. Of course null values should not be confused with empty strings.
@clemensv cloudschema field? Is that an extension?
Any update from @clemensv ? I am unaware of cloudschema and it sounds like it is an extension, and in that case if it does come in or out as an empty string or nil, I am not sure the go-sdk will know to omit it as an extension. Is that the bug?