title: multipart max file size validation for multiple routes in a spring boot application
body: <p>I have a spring boot service which need to validate multipart max file size in different rest routes for example all v1 routes for 5MB and v2 for 10MB</p>
  <pre><code>e.g: api/v1/route1 -&gt; max file upload size is 5MB
       api/v2/route2 -&gt; max file upload size is 10MB
       api/v2/route3 -&gt; max file upload size is 2MB              
  </code></pre>
  <p>Already below is set but then all request would be validate against it include v1 route</p>
  <pre><code>servlet:
          multipart:
              max-file-size: 10MB
              max-request-size: 10MB
  </code></pre>
  <p>I was thinking what is the best way to implement it.</p>
  <ol>
  <li><p>Is it keep the max 10MB limit as general value as above in application level and in each route do the validations using MultipartFile getSize() method</p>
  </li>
  <li><p>Any other better way to do it in a interceptor or something by checking request path?</p>
  </li>
  </ol>