0

i googled for hours now but didn't find any solution and maybe the entire features isn't available at all.

Setup:

  • we have a few microservices
  • each service have a jax-rs 2.0 api which contains our endpoint and dto definitions
  • the dto's contain validation anotations like @NotNull or @Min, @Max and so on
  • the api is implemented on server side with resteasy and spring
  • on client side we use the resteasy proxy client with the service api

Is there a way to tell the resteasy proxy client to validate the retrieved data with the anotations in the DTO's? All examples i have found are just on server side for @Post anotated methods. Since most of our clients are just using GET methods to retrieve data from the service there is no such validation, so it's possible that a client retrieve data from a service which did not fit to the specification in the DTO's (for example a property marked with @NotNull is null caused by a bug on server side).

Maybe i'm on a complete wrong path, but maybe i just didn't find the right documentation for this ...

thx in advance

Jens
  • 1
  • 1
  • I don't think you use bean validation on the client side. You can try to call the Bean Validation API directly on them client side (maybe in a filter), but if I were you I would not do this. Maybe make asserts on the Server, exposed via a health check? – vikarjramun Feb 14 '18 at 15:55
  • yes i already thought about doing it manually, but hoped i just have to enable a feature in the objectmapper or something – Jens Feb 14 '18 at 16:05

0 Answers0