Skip to content

Conversation

@devin-ai-integration
Copy link

feat: migrate from Springfox to SpringDoc OpenAPI for Java 11 compatibility

Summary

Migrated API documentation from Springfox 2.9.2 to SpringDoc OpenAPI 1.6.15 to ensure compatibility with Java 11 and Spring Boot 2.1.4.

Changes:

  • Replaced springfox-swagger2 and springfox-swagger-ui dependencies with springdoc-openapi-ui (1.6.15)
  • Updated ApplicationConfig.java to use SpringDoc's OpenAPI bean instead of Springfox Docket
  • Removed Springfox annotations from controllers (@Api, @ApiOperation, @ApiResponses)
  • SpringDoc now auto-generates API documentation from Spring MVC annotations

Why SpringDoc instead of Springfox 3.0.0?

  • Springfox 3.0.0 has known compatibility issues with Spring Boot 2.1.4
  • SpringDoc OpenAPI is actively maintained and provides better Java 11+ support
  • Auto-documentation reduces maintenance burden

Testing Performed:

  • ✅ Compilation: mvn clean compile - BUILD SUCCESS
  • ✅ Tests: mvn test - All tests pass (1/1)
  • ✅ Runtime: Application starts successfully on port 8989
  • ✅ Swagger UI: Verified accessible at http://localhost:8989/bank-api/swagger-ui.html

Swagger UI Screenshot

Review & Testing Checklist for Human

  • Verify Swagger UI: Access http://localhost:8989/bank-api/swagger-ui.html and confirm all endpoints are visible (customer-controller: 5 endpoints, account-controller: 4 endpoints)
  • Check API Documentation Quality: Review auto-generated documentation and confirm it's acceptable compared to previous manual annotations (may have less detail on response codes/descriptions)
  • Test API Functionality: Use Swagger UI to test 1-2 endpoints (e.g., GET /customers/all, POST /customers/add) to verify functionality is unchanged

Notes

Devin Session: https://app.devin.ai/sessions/584c47c834034aa4a29be5e1c9db7d8b
Requested by: Jaime Mizrachi (@jaime-leo)

Known Tradeoffs:

  • Auto-generated documentation may have less detail than manual Swagger annotations
  • SpringDoc uses OpenAPI 3.0 format (vs Springfox's Swagger 2.0), which is more modern but slightly different

Future Considerations:

  • If more detailed API docs are needed, SpringDoc supports adding @Operation, @ApiResponse annotations from io.swagger.v3.oas.annotations package
  • Current approach prioritizes maintainability (no manual annotation maintenance) over exhaustive documentation

…bility

- Replace Springfox 2.x dependencies with SpringDoc OpenAPI 1.6.15
- Update ApplicationConfig to use SpringDoc's OpenAPI configuration
- Remove Springfox annotations from controllers (auto-documentation enabled)
- Verify compilation, tests, and Swagger UI functionality

Springfox 3.0.0 was incompatible with Spring Boot 2.1.4, so migrated to
SpringDoc OpenAPI which provides better compatibility and is actively maintained.

Co-Authored-By: Jaime Mizrachi <[email protected]>
@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.

1 participant