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

Vnd.error links key on json response #345

Closed
fjginermontagud opened this issue May 19, 2015 · 1 comment
Closed

Vnd.error links key on json response #345

fjginermontagud opened this issue May 19, 2015 · 1 comment
Labels
in: configuration Configuration and setup in: mediatypes Media type related functionality
Milestone

Comments

@fjginermontagud
Copy link

I noticed that "links" key don't has underscore at beginning (_links), and this not conform to the vnd.error specs.

For example:

[
    {
        "logref": "error",
        "message": "Could not find test",
        "links": [
            {
                "rel": "about",
                "href": "http://..."
            }
        ]
    }
]

This vnd.error is produced by this code:

@ControllerAdvice
class TestControllerAdvice {

    @ResponseBody
    @ExceptionHandler(TestNotFoundException.class)
    @ResponseStatus(HttpStatus.NOT_FOUND)
    VndErrors testNotFoundExceptionHandler(TestNotFoundException ex) {
        return new VndErrors(
                "error",
                ex.getMessage(),
                new Link("http://...", "about")
        );
    }
}
@gregturn
Copy link
Contributor

VndErrors is incredibly HAL specific. It leans on having registered the Jackson2HalModule to properly render things.

We clean up the implementation to better match the spec via 4f3be11, but are planning to deprecate the whole things and embrace RFC-7807

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

No branches or pull requests

2 participants