Message ID | 20231006114436.1725425-2-jiri@resnulli.us (mailing list archive) |
---|---|
State | Accepted |
Commit | e18f3dc2beaa5055e27334cd2d8b492bc3e9b3a4 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | tools: ynl-gen: lift type requirement for attribute subsets | expand |
Context | Check | Description |
---|---|---|
netdev/series_format | success | Posting correctly formatted |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/fixes_present | success | Fixes tag not required for -next series |
netdev/header_inline | success | No static functions without inline keyword in header files |
netdev/build_32bit | success | Errors and warnings before: 9 this patch: 9 |
netdev/cc_maintainers | success | CCed 5 of 5 maintainers |
netdev/build_clang | fail | Errors and warnings before: 17 this patch: 17 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/deprecated_api | success | None detected |
netdev/check_selftest | success | No net selftest shell script |
netdev/verify_fixes | success | No Fixes tag |
netdev/build_allmodconfig_warn | fail | Errors and warnings before: 17 this patch: 17 |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 104 lines checked |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/source_inline | success | Was 0 now: 0 |
On Fri, 6 Oct 2023 13:44:35 +0200 Jiri Pirko wrote: > + # type property is only required if not in subset definition > + if: > + properties: > + subset-of: > + not: > + type: string > + then: > + properties: > + attributes: > + items: > + required: [ type ] Nice! Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Fri, Oct 06, 2023 at 05:00:39PM CEST, kuba@kernel.org wrote: >On Fri, 6 Oct 2023 13:44:35 +0200 Jiri Pirko wrote: >> + # type property is only required if not in subset definition >> + if: >> + properties: >> + subset-of: >> + not: >> + type: string >> + then: >> + properties: >> + attributes: >> + items: >> + required: [ type ] > >Nice! Took me like 3 hours debugging this. These json schemas are from different world than I am... > >Reviewed-by: Jakub Kicinski <kuba@kernel.org>
On Fri, 6 Oct 2023 18:55:37 +0200 Jiri Pirko wrote: > Took me like 3 hours debugging this. These json schemas are from > different world than I am... That makes two of us. One of the most confusing languages I've worked with.. The effort is very much appreciated! :)
diff --git a/Documentation/netlink/genetlink-c.yaml b/Documentation/netlink/genetlink-c.yaml index 9806c44f604c..32736b2d8ae8 100644 --- a/Documentation/netlink/genetlink-c.yaml +++ b/Documentation/netlink/genetlink-c.yaml @@ -142,7 +142,7 @@ properties: type: array items: type: object - required: [ name, type ] + required: [ name ] additionalProperties: False properties: name: @@ -215,6 +215,18 @@ properties: not: 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: description: Operations supported by the protocol. type: object diff --git a/Documentation/netlink/genetlink-legacy.yaml b/Documentation/netlink/genetlink-legacy.yaml index 12a0a045605d..25fe1379b180 100644 --- a/Documentation/netlink/genetlink-legacy.yaml +++ b/Documentation/netlink/genetlink-legacy.yaml @@ -180,7 +180,7 @@ properties: type: array items: type: object - required: [ name, type ] + required: [ name ] additionalProperties: False properties: name: @@ -254,6 +254,18 @@ properties: not: 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: description: Operations supported by the protocol. type: object diff --git a/Documentation/netlink/genetlink.yaml b/Documentation/netlink/genetlink.yaml index 3d338c48bf21..6ea1c947ce51 100644 --- a/Documentation/netlink/genetlink.yaml +++ b/Documentation/netlink/genetlink.yaml @@ -115,7 +115,7 @@ properties: type: array items: type: object - required: [ name, type ] + required: [ name ] additionalProperties: False properties: name: @@ -184,6 +184,18 @@ properties: not: 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: description: Operations supported by the protocol. type: object diff --git a/Documentation/netlink/netlink-raw.yaml b/Documentation/netlink/netlink-raw.yaml index 896797876414..d976851b80f8 100644 --- a/Documentation/netlink/netlink-raw.yaml +++ b/Documentation/netlink/netlink-raw.yaml @@ -187,7 +187,7 @@ properties: type: array items: type: object - required: [ name, type ] + required: [ name ] additionalProperties: False properties: name: @@ -261,6 +261,18 @@ properties: not: 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: description: Operations supported by the protocol. type: object