Skip to content

feat(api-doc): support request parameter parsing for RPC types (Dubbo/SOFA/TARS/gRPC)#6339

Open
eye-gu wants to merge 4 commits into
apache:masterfrom
eye-gu:fix-6338
Open

feat(api-doc): support request parameter parsing for RPC types (Dubbo/SOFA/TARS/gRPC)#6339
eye-gu wants to merge 4 commits into
apache:masterfrom
eye-gu:fix-6338

Conversation

@eye-gu
Copy link
Copy Markdown
Contributor

@eye-gu eye-gu commented May 12, 2026

close #6338

Previously, API document generation only supported Spring Web annotation-based parameter parsing (@RequestParam, @RequestPart, path variables), which only works for HTTP/WebSocket/Spring Cloud. RPC types (Dubbo, SOFA, TARS, gRPC) had no request parameter information in generated documents.

Changes

OpenApiUtils - RPC-aware document generation

  • Add buildDocumentJson() that dispatches by RPC type:
    • Dubbo/TARS: parse request parameters from Java method signatures
    • gRPC: parse request/response from StreamObserver method pattern
    • Dubbo + Protobuf: parse protobuf message fields via reflection for both request and response
    • HTTP/WebSocket/Spring Cloud: unchanged Spring MVC annotation parsing
  • Unify document fields to requestParameters / responseParameters

SOFA - enable API document support

  • Refactor SofaServiceEventListener to extend AbstractContextRefreshedEventListener common flow
  • Replace custom handler() / onApplicationEvent() with standard getCorrectedClass() + buildApiPath() hooks
  • SOFA services now go through the unified API doc registration pipeline

Examples

  • Add @ApiModule / @ApiDoc annotations to Dubbo protobuf example services

Impact

  • Dubbo/SOFA/TARS/gRPC API documents now include detailed request parameter schemas
  • SOFA module gains API document generation capability
  • No breaking change for HTTP/WebSocket/Spring Cloud document generation

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

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.

[BUG] API Document generation does not parse request parameters for RPC types (Dubbo/SOFA/TARS/gRPC)

1 participant