Giter Site home page Giter Site logo

Comments (2)

carltongibson avatar carltongibson commented on June 8, 2024

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.)

from apistar.

nielskou avatar nielskou commented on June 8, 2024

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

from apistar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.