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
{{ message }}
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.
I tried to validate the schema from README, but got an error:
> apistar validate --path schema.yaml
Traceback (most recent call last):
File "/home/u1/.virtualenvs/videospeed/bin/apistar", line 10, in <module>
sys.exit(cli())
File "/home/u1/.virtualenvs/videospeed/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/u1/.virtualenvs/videospeed/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/u1/.virtualenvs/videospeed/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/u1/.virtualenvs/videospeed/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/u1/.virtualenvs/videospeed/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/u1/.virtualenvs/videospeed/lib/python3.7/site-packages/apistar/cli.py", line 163, in validate
}[format]
KeyError: None
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: