On 2/7/19 8:01 AM, Eric Blake wrote:

>> I think there is: we could provide for an *optional* default value.  If
>> the schema specifies it, that's what 'absent' means.  If it doesn't, all
>> bets are off, just like they are now.
> 
> And we already have the planned syntax, thanks to our recent work on
> adding conditionals - where we now have:
> 
> { '*field': 'mytype' }
> 
> we can also do long-hand:
> 
> { { 'name': '*field', 'type': 'mytype' } }

I'd better use the actual syntax, instead of inventing non-JSON off the
top of my head:

{ '*field': { 'type': 'mytype' } }

> 
> which also lends itself well to declaring a default:
> 
> { { 'name': '*field', 'type': 'mytype', 'default': 'xyz' } }

{ '*field': { 'type': 'mytype', 'default': 'xyz' } }

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to