Subject: Re: [PATCH net-next v3 2/8] netlink: add schemas for YAML specs

From: Jakub Kicinski <[email-masked]>
Date: Thu, 19 Jan 2023 14:24:45 -0800

On Thu, 19 Jan 2023 13:49:22 -0800 Jakub Kicinski wrote:
> > Generally you put common schemas under '$defs' and the then reference
> > them with '$ref'.
> > 
> > $defs:
> >   some-prop-type:
> >     type: integer
> >     minimum: 0
> > 
> > properties:
> >   foo:
> >     $ref: '#/$defs/some-prop-type'
> >   bar:
> >     $ref: '#/$defs/some-prop-type'  
> 
> Thanks! Is it possible to move the common definitions to a separate
> file? I tried to create a file called defs.yaml and change the ref to:
> 
>   $ref: "defs.yaml#/$defs/len-or-define"

Oh, oh. Instead of trying to create 3 different "levels" of spec,
and having to pull out shared definitions maybe I can use the 
  if + unevaluatedProperties
to only allow certain properties depending on the value in the
"protocol" attribute...