Thread (31 messages) 31 messages, 6 authors, 2023-01-20

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

From: Jakub Kicinski <kuba@kernel.org>
Date: 2023-01-20 05:36:54
Also in: linux-doc

On Thu, 19 Jan 2023 13:49:22 -0800 Jakub Kicinski wrote:
quoted
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...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help