Open Fak3 opened 5 years ago
I'm seeing something related here. With a not-greatâ„¢ schema I get some a hoped for
typesystem.base.ValidationError: {'info': {'title': 'This field is required.', 'version': 'This field is required.'}, 'paths': ...
But when handling that something else comes up:
During handling of the above exception, another exception occurred:
...
File "...apistar/cli.py", line 137, in validate
apistar.validate(content, format=format, encoding=encoding)
File "...apistar/core.py", line 75, in validate
value = typesystem.validate_with_positions(token=token, validator=validator)
File "...typesystem/tokenize/positional_validation.py", line 19, in validate_with_positions
token = token.lookup(message.index[:-1])
File "...typesystem/tokenize/tokens.py", line 46, in lookup
token = token._get_child_token(key)
File "...typesystem/tokenize/tokens.py", line 95, in _get_child_token
return self._child_tokens[key]
KeyError: 'info'
So the end result is not great UI. (The underlying ValidationError
is super-informative, so ideally that would be surfaced, even if other info isn't available.)
I read in the source code that the apistar configuration file must be named apistar.yml
and not apistar.yaml
. That solved it for me. This is especially confusing because the schema file is named schema.yaml
I tried to validate the schema from README, but got an error: