I am using Swagger to get response of PUT() method. I have created a filter to limit request body size to 10000kb in my Spring boot Application. When I send request os size greater than 10000kb, i get swagger response as below.
Response Body :"no content"
Response code: 500
I referred below link Spring boot Embedded Tomcat "application/json" post request restriction to 10KB
I used below to register the filter..
@Bean
public FilterRegistrationBean loginRegistrationBean() {
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
filterRegistrationBean.setFilter(new ApplicationJsonRequestSizeLimitFilter());
filterRegistrationBean.setUrlPatterns(Collections.singletonList("/*"));
return filterRegistrationBean;
}
How can i get status code, and custom message thrown by filter in response body.