Skip to content

Instantly share code, notes, and snippets.

@namila007
Created March 31, 2019 15:32
Show Gist options
  • Save namila007/900cf5e2929ccd2399bf9609fbb5f72f to your computer and use it in GitHub Desktop.
Save namila007/900cf5e2929ccd2399bf9609fbb5f72f to your computer and use it in GitHub Desktop.
validation url
@GetMapping(value = "/{id}")
public ResponseWrapper<Author> getAuthorById(
@Valid @Pattern(regexp = REGEX_FOR_NUMBERS, message = MESSAGE_FOR_REGEX_NUMBER_MISMATCH) @PathVariable(value = "id") String id )
{
return new ResponseWrapper<>( authorMainService.getById( Integer.parseInt( id ) ), HttpStatus.OK );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment