You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type volume_type =
| Data (** Normal data volume *)
| CBT_Metadata (** CBT Metadata only, data destroyed *)
| Data_and_CBT_Metadata (** Both Data and CBT Metadata *)
and then the generator is run the Python code looks like
if tmp_26['volume_type'][0] not in ["Data", "CBT_Metadata", "Data_and_CBT_Metadata"]:
raise TypeError("| Data (unit) (** Normal data volume *) | CBT_Metadata (unit) (** CBT Metadata only, data destroyed *) | Data_and_CBT_Metadata (unit) (** Both Data and CBT Metadata *)", repr(tmp_26['volume_type']))
which then throws a KeyError if the value is not passed, which is obviously not the intent when placing an @default in the definition.
I think it should be using tmp_26.get('volume_type', "Data")[0] instead
The text was updated successfully, but these errors were encountered:
@mseri thinking about this some more, as it is "only" the validation code for the API responses it would probably be better as
if '<key> in tmpXX:
<existing code fragment>
There seems little point having the Python code do default substitution here when the return value isn't going to contain that data. But, only for those fields with an @default qualifier
If something like
where volume_type is
and then the generator is run the Python code looks like
which then throws a
KeyError
if the value is not passed, which is obviously not the intent when placing an@default
in the definition.I think it should be using
tmp_26.get('volume_type', "Data")[0]
insteadThe text was updated successfully, but these errors were encountered: