-
Notifications
You must be signed in to change notification settings - Fork 980
Open
Labels
Description
Problem
Currently, docstring keys use only the class name and method name, causing overloaded methods to share the same key and overwrite each other's descriptions.
Current format: <fqcn>/<method>
This causes issues when multiple overloaded methods have different @ReturnDescription, @ThrowsDescription, or parameter descriptions, as they all map to the same key.
Proposed Solution
Update docstring key format to include the full method signature:
Desired format: <fqcn>/<method>(<method_signature>)
Example: com.example.MyService/myMethod(com.example.FirstParam,com.example.SecondParam)
Additional Requirements
- Always use fully-qualified class names (FQCN) for:
- Parameter types in method signatures
- Return types in
:returnkeys - Exception types in
:throws/keys
Example Keys
- Method description:
com.example.MyService/myMethod(java.lang.String,int) - Return description:
com.example.MyService/myMethod(java.lang.String,int):return - Exception description:
com.example.MyService/myMethod(java.lang.String,int):throws/com.example.CustomException - Parameter description:
com.example.MyService/myMethod(java.lang.String,int):param/paramName
Implementation Notes
This involves two related fixes:
- Incorporating method signature into keys to distinguish overloads
- Ensuring FQCN usage throughout all docstring key components
Both should be handled together as they are interrelated.
Context
- Related PR: Add docstring support for return types and exception types in MethodInfo #6605
- Comment thread: Add docstring support for return types and exception types in MethodInfo #6605 (comment)
Affected Code
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedDocServicePlugin.javaextractMethodDescription()extractReturnDescription()extractThrowsDescriptions()extractParameterDescriptions()
- Similar patterns in gRPC and Thrift plugins may need updating
- Properties file format and parsing logic
- UI/client code that looks up docstrings by key
Reactions are currently unavailable