API Design

RESTful API design principles and best practices

Adventuretube REST API Architecture Principle

1. Correct Design of Controller and Service Principle: Thin Controller, Fat Service Controllers should only handle HTTP concerns: routing, request/response formatting, and returning status codes. Services should encapsulate business logic, including all validations and error throwing. Why This Matters 1. Separation of Concerns Layer Responsibility Controller Handle HTTP interface Service Contain domain logic and validation […]

Adventuretube REST API Architecture Principle Read More »

API Design

URI Construction and API Response Annotations in AuthController

1. Overview This document analyzes the register method in AuthController, focusing on the construction of the URI and the @ApiResponse annotations that define the API response structure. 2. Code Snippet @Operation(summary = “Signup user”) @ApiResponse(responseCode = “201”) // Created //@ApiResponse(responseCode = “404”, content = @Content(schema = @Schema(implementation = CommonErrorResponse.class))) @ApiResponse(responseCode = “401”, content = @Content(schema

URI Construction and API Response Annotations in AuthController Read More »

API Design