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

Return full validation failure message if new schema fails validation #48

Closed
alexanderdean opened this issue Jul 31, 2014 · 4 comments
Closed
Assignees
Labels
Milestone

Comments

@alexanderdean
Copy link
Member

Not just an error message, but the full JSON Schema validation failure.

@alexanderdean alexanderdean added this to the Version 0.3.0 milestone Jul 31, 2014
BenFradet added a commit that referenced this issue Aug 4, 2014
… as described in #48, still needs pretty printing though
@BenFradet
Copy link
Contributor

Pretty much done except for pretty printing.

@BenFradet
Copy link
Contributor

This is done, in case of a failed validation the api will return the following json:

{
  "status": 400,
  "message": "The json provided is not a valid self-describing json",
  "report": {
        "level": "error",
        "schema": {
            "loadingURI": "#",
            "pointer": ""
        },
        "instance": {
            "pointer": ""
        },
        "domain": "validation",
        "keyword": "allOf",
        "message": "instance failed to match all required schemas (matched only 1 out of 2)",
        "matched": 1,
        "nrSchemas": 2,
        "reports": {
            "/allOf/0": [
                {
                    "level": "error",
                    "schema": {
                        "loadingURI": "#",
                        "pointer": "/allOf/0"
                    },
                    "instance": {
                        "pointer": ""
                    },
                    "domain": "validation",
                    "keyword": "required",
                    "message": "object has missing required properties ([\"self\"])",
                    "required": [
                        "self"
                    ],
                    "missing": [
                        "self"
                    ]
                }
            ],
            "/allOf/1": []
        }
    }
}

for example, the point is the full report will come along.

@alexanderdean
Copy link
Member Author

Great work Ben!

@BenFradet BenFradet added the done label Aug 11, 2014
@BenFradet BenFradet modified the milestones: Release 3, Release 2 Aug 19, 2014
@BenFradet
Copy link
Contributor

Done in r2, closing.

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

No branches or pull requests

2 participants