Skip to content

Comments

feat(EM-45): Define REST API Standards and Migrate from Springfox to SpringDoc OpenAPI 3#46

Open
devin-ai-integration[bot] wants to merge 1 commit intofeat/microservices-migration-v2from
devin/1771605374-em45-api-standards
Open

feat(EM-45): Define REST API Standards and Migrate from Springfox to SpringDoc OpenAPI 3#46
devin-ai-integration[bot] wants to merge 1 commit intofeat/microservices-migration-v2from
devin/1771605374-em45-api-standards

Conversation

@devin-ai-integration
Copy link

feat(EM-45): Add ftgo-api-standards library with SpringDoc OpenAPI 3 config

Summary

Creates the libs/ftgo-api-standards/ shared library to replace the monolith's Springfox-based common-swagger module with SpringDoc OpenAPI 3. Includes:

  • Standard response DTOs: ApiResponse<T> (success/error envelope), ErrorResponse (with field-level errors), PageResponse<T> (pagination wrapper)
  • SpringDoc auto-configuration: FtgoOpenApiAutoConfiguration that creates an OpenAPI bean with configurable info, Bearer JWT security scheme, and server definitions via FtgoApiProperties (ftgo.api.* prefix)
  • Spring Boot 3.x auto-discovery via META-INF/spring/AutoConfiguration.imports
  • Version catalog update: Added springdoc-openapi-starter-common library alias to gradle/libs.versions.toml
  • REST API standards documentation in docs/api-standards/: naming conventions, versioning strategy (URL path-based), and error handling standards

The module is a standalone Gradle 8.7 project (matching sibling ftgo-common's pattern), with unit tests for all DTOs and the auto-configuration. Build passes with all tests green. No existing monolith source files or root settings.gradle were modified.

Review & Testing Checklist for Human

  • Standalone module architecture: The module has its own Gradle wrapper (8.7) and settings.gradle, consistent with ftgo-common. Confirm this standalone structure works for your composite build / service consumption strategy — services will need to declare a dependency on this module somehow (composite build, local maven publish, etc.)
  • Hardcoded dependency versions: build.gradle hardcodes springdoc 2.5.0, spring-boot 3.2.5, jackson 2.17.0 etc. rather than referencing the version catalog (standalone projects can't). Verify these match libs.versions.toml and accept the version-drift risk, or consider adding a comment/check
  • No reusable GlobalExceptionHandler: The error-handling.md doc shows example @RestControllerAdvice code, but the library only provides the ErrorResponse DTO — each service must implement its own handler. Confirm this is the desired boundary
  • Integration test gap: Unit tests verify auto-config bean creation, but don't test actual /swagger-ui or /v3/api-docs endpoint availability. Consider adding a @SpringBootTest integration test in a follow-up if needed
  • Documentation alignment: Review docs/api-standards/*.md to ensure naming conventions, versioning strategy, and error codes match team standards

Notes

…config

- Create libs/ftgo-api-standards/ shared library module
- Define standard API response DTOs (ApiResponse, ErrorResponse, PageResponse)
- Configure SpringDoc OpenAPI 3 auto-configuration with FtgoApiProperties
- Add Bearer JWT security scheme support
- Add springdoc-openapi-starter-common to version catalog
- Create REST API standards docs (naming conventions, versioning, error handling)
- Add unit tests for all DTOs and auto-configuration

Co-Authored-By: Alex Baker <alexandercommander453@gmail.com>
@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants