Create interfaces that are intuitive, consistent, and stable
API breaking changes must be introduced only through explicit version increments using @RequestMapping version attributes, Accept header versioning, or URI path versioning (/api/v1/) to ensure existing clients continue functioning without modification.
All REST endpoints must validate input data types and formats using Bean Validation annotations (@Valid, @NotNull, @Size, @Pattern), Spring’s @Validated, or custom validators before processing requests to prevent invalid data from causing system errors or corruption.
REST endpoints must validate and enforce required fields in request payloads using @NotNull, @NotBlank, @NotEmpty annotations, returning standardized 400 Bad Request responses with clear validation error messages when mandatory data is missing.