Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issue with empty optional keywords #811

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

jsolaas
Copy link
Contributor

@jsolaas jsolaas commented Feb 26, 2025

If specifying only a keyword without the data for an optional keyword in
the yaml we would not get a validation error. I.e. the json-schema did
not capture the error. In addition, the validation context setup did not
account for None in the data, expecting either unset or some data (not
None). This caused a type error since we then tried to use None as a
list.

Adding only MODELS: to the yaml would reproduce the error. Removing
MODELS: or adding an empty list MODELS: [] would make it valid.

@jsolaas jsolaas requested a review from a team as a code owner February 26, 2025 19:56
@jsolaas jsolaas force-pushed the fix/yaml-validation-type-error branch from ace34aa to a498551 Compare February 26, 2025 20:03
If specifying only a keyword without the data for an optional keyword in
the yaml we would not get a validation error. I.e. the json-schema did
not capture the error. In addition, the validation context setup did not
account for None in the data, expecting either unset or some data (not
None). This caused a type error since we then tried to use None as a
list.

Adding only `MODELS:` to the yaml would reproduce the error. Removing
`MODELS:` or adding an empty list `MODELS: []` would make it valid.
@jsolaas jsolaas force-pushed the fix/yaml-validation-type-error branch from a498551 to f081d6f Compare February 27, 2025 12:20
@jsolaas jsolaas merged commit e405c0b into main Feb 27, 2025
8 checks passed
@jsolaas jsolaas deleted the fix/yaml-validation-type-error branch February 27, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants