From 5ed500746d482cc06dc7d563c2905eadf321c3cd Mon Sep 17 00:00:00 2001 From: saleksandra Date: Mon, 22 Jul 2019 13:37:05 +0200 Subject: [PATCH] OLMIS-6408: Information about pageable validator added to the documentation --- STYLE-GUIDE.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/STYLE-GUIDE.md b/STYLE-GUIDE.md index 2921934..fdedf45 100644 --- a/STYLE-GUIDE.md +++ b/STYLE-GUIDE.md @@ -133,6 +133,10 @@ as empty. * Resource's which only ever return a single identified item are _not_ paginated. * For Java Service's the query parameters should be defined by a [Pageable](http://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/domain/Pageable.html) and the response should be a [Page](http://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/domain/Page.html). +* Before executing any endpoint, parameters are validated. Currently checked parameters are `page` and `size`. +Validator is called by interceptor which is registered with `InterceptorRegistry` by using `CustomWebMvcConfigurerAdapter`. +The endpoint return bad request error with an error message when `page` parameter is defined and `size` parameter is not +specified or `size` parameter is not greater than zero. Example Request (note that page is zero-based): ```