Graylog2 / Graylog2/graylog2-server

Display details about validation errors

Open
#1,440 0 comments 0 reactions 0 assignees View on GitHub
improvement
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

As a user of the Graylog REST API, I would like to see why the validation of a request failed.

Graylog is using [bean validation](http://beanvalidation.org/) and especially [Jersey Bean Validation](https://jersey.java.net/documentation/2.21/bean-validation.html) to validate DTOs in several places.

If an HTTP request to the Graylog REST API contains an invalid payload, the default ExceptionMapper of the Jersey Bean Validation feature generates an empty response with HTTP status 400.

Jersey Bean Validation supports printing the original `ConstraintViolationExcpetion` with a simple property (https://jersey.java.net/documentation/2.21/bean-validation.html#d0e13826) but the format doesn't match the other error responses, which is why Graylog should implement its own exception mapper for `ConstraintViolationException`s.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.