Thread (16 messages) 16 messages, 2 authors, 2024-03-07

Re: [PATCH net-next v2 5/5] doc/netlink/specs: Add spec for nlctrl netlink family

flat view

From: Jakub Kicinski <kuba@kernel.org>
Date: 2024-03-07 00:04:59

On Wed, 6 Mar 2024 22:54:08 +0000 Donald Hunter wrote:
quoted hunk ↗ jump to hunk
quoted
I've used
        enum-name:
i.e. empty value in other places.
Is using empty string more idiomatic?  
I got this when I tried to use an empty value, so I used '' everywhere instead.

jsonschema.exceptions.ValidationError: None is not of type 'string'

Failed validating 'type' in
schema['properties']['attribute-sets']['items']['properties']['enum-name']:
    {'description': 'Name for the enum type of the attribute.',
     'type': 'string'}

On instance['attribute-sets'][1]['enum-name']:
    None

It turns out that the fix for that is a schema change:
--- a/Documentation/netlink/genetlink-legacy.yaml
+++ b/Documentation/netlink/genetlink-legacy.yaml
@@ -169,7 +169,7 @@ properties:
           type: string
         enum-name:
           description: Name for the enum type of the attribute.
-          type: string
+          type: [ string, "null" ]
         doc:
           description: Documentation of the space.
           type: string
I'll respin with a cleaned up nlctrl spec and fixes for the schemas.
Hm, is this some new version of jsonschema perhaps?
We use empty values all over the place:

$ git grep 'enum-name:$' -- Documentation/netlink/specs/
Documentation/netlink/specs/ethtool.yaml:    enum-name:
Documentation/netlink/specs/fou.yaml:    enum-name:
Documentation/netlink/specs/ovs_datapath.yaml:    enum-name:
Documentation/netlink/specs/ovs_flow.yaml:    enum-name:
Documentation/netlink/specs/ovs_flow.yaml:    enum-name:
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help