katharsis-project / katharsis-framework

Katharsis adds powerful layer for RESTful endpoints providing implementenation of JSON:API standard
http://katharsis.io
Apache License 2.0
135 stars 65 forks source link

ConstraintViolation.getMessage() always returns null when using ValidationModule #435

Closed erdi closed 7 years ago

erdi commented 7 years ago

I'm installing ValidationModule from 3.0.2 in the server and in KatharsisClient and the ConstraintViolations that are contained within ConstraintViolationExceptions thrown by the client always return null for their message property.

I believe this is down to the message being set as the title of ErrorData in ConstraintViolationExceptionMapper but then read from details of ErrorData in ConstraintViolationImpl.

chb0github commented 7 years ago

Thanks for the info. What DI are you using?

On Fri, Jun 16, 2017, 5:15 AM Marcin Erdmann notifications@github.com wrote:

I'm using ValidationModule in the server and with KatharsisClient and the ConstraintViolations that are contained within ConstraintViolationExceptions thrown by the client always return null for their message property.

I believe this is down to the message being set as the title of ErrorData in ConstraintViolationExceptionMapper but then read from details of ErrorData in ConstraintViolationImpl.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/katharsis-project/katharsis-framework/issues/435, or mute the thread https://github.com/notifications/unsubscribe-auth/ABaI0DW1Y2o0o5SflDdtAr0QWseNHsNdks5sEnHZgaJpZM4N8Yuc .

erdi commented 7 years ago

Why would the DI I'm using and even if I'm using a DI matter for this?

chb0github commented 7 years ago

because spring already has several ready-to-go validators and you won't need to use the validation module. The original author of the validation module is gone and the whole module has been removed. You're literally the first to use it.

erdi commented 7 years ago

I don't see what the fact that Spring has some ready-to-go validators has to do with this. The validation module was validator agnostic as it was about translating JSR-303's ConstraintViolationExceptions and ValidationExceptions to and from JSON API messages.

Thanks for letting me know that the module is gone. I reckon there is no point in this issue then so I'm closing it.

chb0github commented 7 years ago

It means you could use the one in spring and not worry about the behavior in this module. Since I knew the module was gone I was suggesting an alternative.

Good luck

On Fri, Jun 16, 2017 at 1:46 PM Marcin Erdmann notifications@github.com wrote:

I don't see what the fact that Spring has some ready-to-go validators has to do with this. The validation module was validator agnostic as it was about translating JSR-303's ConstraintViolationExceptions and ValidationExceptions to and from JSON API messages.

Thanks for letting me know that the module is gone. I reckon there is no point in this issue then so I'm closing it.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/katharsis-project/katharsis-framework/issues/435#issuecomment-309130226, or mute the thread https://github.com/notifications/unsubscribe-auth/ABaI0Gi-cD-tNYC6Rs2C9wqaTX9IgCCdks5sEum0gaJpZM4N8Yuc .