Commit a4cd2f31 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'tools-ynl-gen-lift-type-requirement-for-attribute-subsets'

Jiri Pirko says:

====================
tools: ynl-gen: lift type requirement for attribute subsets

Remove the requirement from schema files to specify the "type" for
attribute subsets and adjust existing schema files.
====================

Link: https://lore.kernel.org/r/20231006114436.1725425-1-jiri@resnulli.usSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents c0423539 7049fd5d
...@@ -142,7 +142,7 @@ properties: ...@@ -142,7 +142,7 @@ properties:
type: array type: array
items: items:
type: object type: object
required: [ name, type ] required: [ name ]
additionalProperties: False additionalProperties: False
properties: properties:
name: name:
...@@ -215,6 +215,18 @@ properties: ...@@ -215,6 +215,18 @@ properties:
not: not:
required: [ name-prefix ] required: [ name-prefix ]
# type property is only required if not in subset definition
if:
properties:
subset-of:
not:
type: string
then:
properties:
attributes:
items:
required: [ type ]
operations: operations:
description: Operations supported by the protocol. description: Operations supported by the protocol.
type: object type: object
......
...@@ -180,7 +180,7 @@ properties: ...@@ -180,7 +180,7 @@ properties:
type: array type: array
items: items:
type: object type: object
required: [ name, type ] required: [ name ]
additionalProperties: False additionalProperties: False
properties: properties:
name: name:
...@@ -254,6 +254,18 @@ properties: ...@@ -254,6 +254,18 @@ properties:
not: not:
required: [ name-prefix ] required: [ name-prefix ]
# type property is only required if not in subset definition
if:
properties:
subset-of:
not:
type: string
then:
properties:
attributes:
items:
required: [ type ]
operations: operations:
description: Operations supported by the protocol. description: Operations supported by the protocol.
type: object type: object
......
...@@ -115,7 +115,7 @@ properties: ...@@ -115,7 +115,7 @@ properties:
type: array type: array
items: items:
type: object type: object
required: [ name, type ] required: [ name ]
additionalProperties: False additionalProperties: False
properties: properties:
name: name:
...@@ -184,6 +184,18 @@ properties: ...@@ -184,6 +184,18 @@ properties:
not: not:
required: [ name-prefix ] required: [ name-prefix ]
# type property is only required if not in subset definition
if:
properties:
subset-of:
not:
type: string
then:
properties:
attributes:
items:
required: [ type ]
operations: operations:
description: Operations supported by the protocol. description: Operations supported by the protocol.
type: object type: object
......
...@@ -187,7 +187,7 @@ properties: ...@@ -187,7 +187,7 @@ properties:
type: array type: array
items: items:
type: object type: object
required: [ name, type ] required: [ name ]
additionalProperties: False additionalProperties: False
properties: properties:
name: name:
...@@ -261,6 +261,18 @@ properties: ...@@ -261,6 +261,18 @@ properties:
not: not:
required: [ name-prefix ] required: [ name-prefix ]
# type property is only required if not in subset definition
if:
properties:
subset-of:
not:
type: string
then:
properties:
attributes:
items:
required: [ type ]
operations: operations:
description: Operations supported by the protocol. description: Operations supported by the protocol.
type: object type: object
......
...@@ -199,54 +199,44 @@ attribute-sets: ...@@ -199,54 +199,44 @@ attribute-sets:
attributes: attributes:
- -
name: reload-stats name: reload-stats
type: nest
- -
name: remote-reload-stats name: remote-reload-stats
type: nest
- -
name: dl-reload-stats name: dl-reload-stats
subset-of: devlink subset-of: devlink
attributes: attributes:
- -
name: reload-action-info name: reload-action-info
type: nest
- -
name: dl-reload-act-info name: dl-reload-act-info
subset-of: devlink subset-of: devlink
attributes: attributes:
- -
name: reload-action name: reload-action
type: u8
- -
name: reload-action-stats name: reload-action-stats
type: nest
- -
name: dl-reload-act-stats name: dl-reload-act-stats
subset-of: devlink subset-of: devlink
attributes: attributes:
- -
name: reload-stats-entry name: reload-stats-entry
type: nest
- -
name: dl-reload-stats-entry name: dl-reload-stats-entry
subset-of: devlink subset-of: devlink
attributes: attributes:
- -
name: reload-stats-limit name: reload-stats-limit
type: u8
- -
name: reload-stats-value name: reload-stats-value
type: u32
- -
name: dl-info-version name: dl-info-version
subset-of: devlink subset-of: devlink
attributes: attributes:
- -
name: info-version-name name: info-version-name
type: string
- -
name: info-version-value name: info-version-value
type: string
operations: operations:
enum-model: directional enum-model: directional
......
...@@ -278,36 +278,28 @@ attribute-sets: ...@@ -278,36 +278,28 @@ attribute-sets:
attributes: attributes:
- -
name: parent-id name: parent-id
type: u32
- -
name: direction name: direction
type: u32
- -
name: prio name: prio
type: u32
- -
name: state name: state
type: u32
- -
name: pin-parent-pin name: pin-parent-pin
subset-of: pin subset-of: pin
attributes: attributes:
- -
name: parent-id name: parent-id
type: u32
- -
name: state name: state
type: u32
- -
name: frequency-range name: frequency-range
subset-of: pin subset-of: pin
attributes: attributes:
- -
name: frequency-min name: frequency-min
type: u64
- -
name: frequency-max name: frequency-max
type: u64
operations: operations:
enum-name: dpll_cmd enum-name: dpll_cmd
......
...@@ -818,13 +818,10 @@ attribute-sets: ...@@ -818,13 +818,10 @@ attribute-sets:
attributes: attributes:
- -
name: hist-bkt-low name: hist-bkt-low
type: u32
- -
name: hist-bkt-hi name: hist-bkt-hi
type: u32
- -
name: hist-val name: hist-val
type: u64
- -
name: stats name: stats
attributes: attributes:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment