[SPRING] Create constants for paths
Created by: adrianiacobghiula
Description
It would be better to generate constants for the paths (in an apiRoute interface)
String FIND_PET_BY_STATUS_URL = "/pet/findByStatus";
@RequestMapping(value = PetApiRoute.FIND_PET_BY_STATUS_URL,
This could be helpful : for testing using mockMvc to to add the constant. for adding the URL in the spring security antMatchers or anywhere you need the actual URL
Suggest a fix/enhancement
Adding a apiRoute.mustache
{{#operations}} public interface {{classname}}Route { {{#operation}} String {{operationIdSnakeCase.toUpperCase}}_URL = "{{{path}}}"; {{/operation}} } {{/operations}}
And
@RequestMapping(value = {{classname}}Route.{{operationIdSnakeCase.toUpperCase}}_URL,
might be enough