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

Unhelpful error message when schema JSON is invalid #1062

Open
schani opened this issue Sep 11, 2018 · 3 comments
Open

Unhelpful error message when schema JSON is invalid #1062

schani opened this issue Sep 11, 2018 · 3 comments
Labels
bug CLI good first issue

Comments

@schani
Copy link
Member

@schani schani commented Sep 11, 2018

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/foo",
  "definitions": {
    "foo": {
      "type": "object",
      "properties": {
        "bar": {
          "$ref": "bar.json#"
        },
      },
      "required": [
        "bar"
      ],
    },
    "title": "foo"
  }
}

Running quicktype CLI with this Schema produces

Error: Internal error: Defined value expected, but got undefined.
@schani schani added bug CLI good first issue labels Sep 11, 2018
@Armaxxx
Copy link

@Armaxxx Armaxxx commented Dec 15, 2020

Let me see how I can help.

@ps173
Copy link

@ps173 ps173 commented Oct 2, 2021

I tried running the above schema with quick type. On my machine it gives a helpful message. To be exact it outputs :

$ quicktype test.json
Error: Syntax error in input JSON test: Parser cannot parse input: unexpected token '}'.

I think that is pretty valid output. Though providing the line number and column will be pretty good

@mindplay-dk
Copy link

@mindplay-dk mindplay-dk commented Jan 18, 2022

Well, this just cost me an entire day of debugging. 🤦‍♂️

For me, the problem was simply malformed CLI arguments combined with missing validation and poor error-reporting.

Might I propose, as an interim fix, we simply make the CLI print out it's configuration options before starting?

That way, we can at least tell if it's trying to do what we're trying to ask for.

My head hurts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug CLI good first issue
Projects
None yet
Development

No branches or pull requests

4 participants