Skip to content

Abdelrhman-Sayed70/api-commons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Commons

api-commons is a lightweight API contract spring boot library that standardizes how services in the platform receive requests and return responses.

It provides data structures that help enforce a consistent API architecture across all services while keeping business logic independent from framework concerns (e.g., Spring HTTP types).

The library introduces unified abstractions for:

  • API requests
  • API responses
  • Paginated responses

This library is designed to support any project by providing generic components that are not tied to a specific domain. It can be used by any service that needs to implement an API contract, regardless of its underlying business logic or data models.


Core Concepts

ServiceRequest

ServiceRequest wraps all incoming request components into a single structure passed to the service layer.

It provides generic access to:

  • Path variables
  • Query parameters
  • Request body
  • Headers
  • Request meta data

ServiceResponse

ServiceResponse standardizes how services return data to the client.

It provides generic access to:

  • Response body
  • Response headers
  • Response business status code

About

Common library for any spring boot project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages