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

Allow VndError to have children. #651

Closed
douglassparker opened this issue Oct 14, 2017 · 1 comment
Closed

Allow VndError to have children. #651

douglassparker opened this issue Oct 14, 2017 · 1 comment
Labels
in: mediatypes Media type related functionality
Milestone

Comments

@douglassparker
Copy link

The vnd error specification vnd error specification allows multiple errors to be reported as a list or by the use of embedded errors. If using embedded errors, only the top error will typically have a logref. From the spec:

Nested Errors

Nested errors may be represented by embedding multiple errors inside a vnd.error resource.

{
    "message": "Validation failed",
    "logref": 42,
    "_links": {
        "describes": {
            "href": "http://path.to/describes"
        },
        "help": {
            "href": "http://path.to/help"
        },
        "about": {
            "href": "http://path.to/user/resource/1"
        }
    },
    "_embedded": {
        "errors": [
            {
                "message": "Username must contain at least three characters",
                "path": "/username",
                "_links": {
                    "about": {
                        "href": "http://path.to/user/resource/1"
                    }
                }
            }
        ]
    }
}

Add code to allow VndError to contain an array of other VndError. To easily serialize correctly, I recommend as the method signature.

VndError[] getErrors()
@gregturn
Copy link
Contributor

Resolved via 4f3be11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: mediatypes Media type related functionality
Projects
None yet
Development

No branches or pull requests

2 participants