Skip to content

Conversation

juliusv
Copy link
Contributor

@juliusv juliusv commented Jan 6, 2017

Update: Now the response looks like this:

In case of a good expression:

HTTP status code: 200 OK.

{
  "status": "success"
}

In case of an error:

HTTP status code: 400 Bad Request.

{
  "error": "parse error at line 1, char 4: could not parse remaining input \",expr\"...",
  "errorType": "bad_data",
  "location": {
    "line": 1,
    "pos": 4
  },
  "status": "error"
}

Fixes #176

Returns a JSON object of the form:

    {
      "valid": true|false
    }

Fixes #176
@juliusv
Copy link
Contributor Author

juliusv commented Jan 6, 2017

@davkal Is this sufficient, or would you like the parser error message in case of an invalid expression as well?

@davkal
Copy link
Contributor

davkal commented Jan 9, 2017

@juliusv The error would be great. But I'd like to merge this first.

@juliusv
Copy link
Contributor Author

juliusv commented Jan 9, 2017

Now the response looks like this:

In case of a good expression:

HTTP status code: 200 OK.

{
  "status": "success"
}

In case of an error:

HTTP status code: 400 Bad Request.

{
  "error": "parse error at line 1, char 4: could not parse remaining input \",expr\"...",
  "errorType": "bad_data",
  "location": {
    "line": 1,
    "pos": 4
  },
  "status": "error"
}

@tomwilkie
Copy link
Contributor

LGTM!

@juliusv juliusv merged commit 2fe7641 into master Jan 9, 2017
@tomwilkie tomwilkie deleted the validate-expr branch January 17, 2017 20:56
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.

3 participants