Subject: Re: [patch net-next v2 1/3] tools: ynl-gen: lift type requirement for attribute subsets

From: Jakub Kicinski <[email-masked]>
Date: Wed, 4 Oct 2023 17:12:02 -0700

On Fri, 29 Sep 2023 15:47:40 +0200 Jiri Pirko wrote:
> --- a/tools/net/ynl/ynl-gen-c.py
> +++ b/tools/net/ynl/ynl-gen-c.py
> @@ -723,6 +723,8 @@ class AttrSet(SpecAttrSet):
>              self.c_name = ''
>  
>      def new_attr(self, elem, value):
> +        if 'type' not in elem:
> +            raise Exception(f"Type has to be set for attribute {elem['name']}")
>          if elem['type'] in scalars:
>              t = TypeScalar(self.family, self, elem, value)
>          elif elem['type'] == 'unused':

Can this still be enforced using JSON schema? Using dependencies 
to make sure that if subset-of is not present type is?