Add a new API endpoint
Build REST endpoints in Quarkus backend services (DDS or AMS) following GDI's API-first approach.
API-first development
GDI follows an API-first methodology where OpenAPI specifications are defined before implementation. This ensures consistent contracts between frontend and backend teams.
Learn from existing examples
The best way to understand how to add an API endpoint is to examine existing implementations in the codebase.
For detailed workflow examples:
- Add metadata fields - Shows the complete workflow for updating OpenAPI definitions and implementing changes in the Discovery Service
- Backend repositories - Review existing resource classes and their corresponding OpenAPI definitions
Key files to examine:
src/main/openapi/- OpenAPI YAML specificationssrc/main/java/.../api/- REST resource implementationssrc/main/java/.../services/- Business logic services
General workflow
Based on the metadata fields guide:
- Update the OpenAPI definition in
src/main/openapi/folder. - Regenerate code:
mvn clean compile. - Implement or update the business logic and mapping.
- Update test cases.
- Verify with automated testing:
mvn test. - View documentation at
http://localhost:8080/q/swagger-ui/.
For specific implementation patterns and detailed steps, refer to existing endpoints in the codebase and the metadata fields guide.