Lcos-000 opened a new pull request, #3740:
URL: https://github.com/apache/dubbo-go/pull/3740

   ## Background
   
   Currently, `google.api.http` annotations do not consistently drive both 
actual HTTP routes and OpenAPI documentation in Triple services.
   
   This PR makes the same HTTP annotations the source of truth for:
   
   - Runtime HTTP transcoding routes
   - Runtime OpenAPI documents
   - Static OpenAPI documents generated by `protoc-gen-triple-openapi`
   
   ## Changes
   
   - Add HTTP transcoding configuration, disabled by default.
   - Add HTTP rule parsing and validation for:
     - HTTP methods and paths
     - Path variables and wildcards
     - `body`
     - `response_body`
     - `additional_bindings`
     - JSON field names
     - `oneof` and invalid field references
   - Register HTTP transcoding routes in the Triple runtime:
     - Preserve canonical Triple route precedence
     - Support group/version-based implementation selection
     - Detect conflicting routes
     - Validate all routes before registration
     - Return 404 for unmatched routes
   - Add request transcoding for:
     - JSON request bodies
     - Path parameters
     - Query parameters
     - Repeated fields, enums, and well-known types
   - Add response transcoding for:
     - Regular message responses
     - `response_body`
     - Scalar and well-known type responses
     - HTTP error status mapping and error details
     - Response metadata and attachments
   - Extend runtime OpenAPI generation with:
     - Path and query parameters
     - Request bodies
     - `response_body` schemas
     - `additional_bindings`
     - Well-known types
     - HTTP route validation and conflict errors
   - Add `use-http-rules=true` support to `protoc-gen-triple-openapi`.
   - Add runtime, static generator, routing, transcoding, and integration tests.
   - Add English and Chinese documentation and examples.
   - Promote the required `grpc-gateway` and Google API dependencies to direct 
dependencies.
   
   ## Compatibility
   
   - HTTP transcoding remains disabled by default.
   - HTTP-rule-based OpenAPI generation remains disabled by default.
   - RPCs without HTTP annotations continue to use the standard Triple route:
   
     `POST /Service/Method`
   
   - Existing canonical Triple routing behavior is preserved.
   
   ## Validation
   
   The following checks pass:
   
   ```bash
   go test -count=1 ./protocol/triple/... ./internal/httpbinding
   go test -count=1 ./...
   ```
   
   The second command is executed in the `tools/protoc-gen-triple-openapi` 
module.
   
   Race detection, `go vet`, and `git diff --check` also pass.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to