Re: in webIDL can a required dictionary member be nullable?

On 7/18/15 2:06 PM, =JeffH wrote:
> if we declare this non-nullable variant in a spec..
>
>     dictionary foo-EmptyStringOK {
>       required DOMString bar;
>       required DOMString baz;
>     };
>
> ..where the above is intended to describe a JSON-serialized on-the-wire
> message, is it legitimate to have actual message instances where the
> value of bar or baz are empty strings, eg "" ?

Sure.

> my understanding is that a serialization of {"bar":null,"baz":null}
> would NOT be ok in the case of foo-EmptyStringOK

Yes.

> but would be ok in the
> case of the foo dictionary way up above because the DOMString members
> therein are declared as nullable.

Correct.

-Boris

Received on Tuesday, 21 July 2015 01:20:51 UTC