API Design

API Design

Create interfaces that are intuitive, consistent, and stable

Enforceable guidelines from our catalog

Breaking Changes Must Use Proper Versioning

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.

Input Data Types Must Be Validated

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.

Required Fields Must Be Enforced

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.

Sign up for free
and get unlimited access to our guidelines catalog