sdk-go icon indicating copy to clipboard operation
sdk-go copied to clipboard

"if present" validation

Open clemensv opened this issue 5 years ago • 5 comments

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.

clemensv avatar May 02 '20 11:05 clemensv

We actually had a discussion about this on Slack almost a year ago: https://cloud-native.slack.com/archives/C9DB5ABAA/p1558713174012100

deissnerk avatar May 02 '20 12:05 deissnerk

@deissnerk the Slack app does not show replies on your question there.

clemensv avatar May 03 '20 17:05 clemensv

@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.

deissnerk avatar May 03 '20 17:05 deissnerk

@clemensv cloudschema field? Is that an extension?

slinkydeveloper avatar May 04 '20 06:05 slinkydeveloper

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?

n3wscott avatar Jun 22 '20 16:06 n3wscott