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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux