fix: allow proto3 optional fields in path parameters#6416
Merged
johanbrandhorst merged 2 commits intogrpc-ecosystem:mainfrom Mar 4, 2026
Merged
fix: allow proto3 optional fields in path parameters#6416johanbrandhorst merged 2 commits intogrpc-ecosystem:mainfrom
johanbrandhorst merged 2 commits intogrpc-ecosystem:mainfrom
Conversation
johanbrandhorst
approved these changes
Mar 4, 2026
Collaborator
johanbrandhorst
left a comment
There was a problem hiding this comment.
LGTM, thank you! I can't think of a reason this would break any existing users, and since this is something multiple users want, lets try it and see how it goes :).
Collaborator
|
Looks like you need to run the regenerate command, see CONTRIBUTING.md for instructions. Thanks! |
auto-merge was automatically disabled
March 4, 2026 17:23
Head branch was pushed to by a user without write access
This was referenced Apr 23, 2026
fix(deps): vuln minor upgrades — 11 packages (minor: 7 · patch: 4) [server]
DataDog/temporalio-ui#27
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References to other Issues or PRs
Fixes #6352
Motivation & Context
This PR removes the compiler restriction (originally introduced in #1951) that prevents
proto3 optionalfields from being mapped to HTTP path parameters.Addressing the Routing Ambiguity Concern:
By removing this check, we decouple the Protobuf schema validation from the HTTP routing layer. If an optional field is mapped to a path parameter like
/owners/{owner_name}/pets/, the structural requirement of the URL template remains intact.If a client omits the optional field, resulting in an empty path segment (
POST /v1/owners//pets/fido:feed), the underlying gRPC-Gateway HTTP router will naturally fail to match the template and return a404 Not Found. This correctly shifts the responsibility of validating path completeness from the proto compiler to the HTTP router, which is the expected behavior for malformed requests.Changes
proto3_optionalcheck ininternal/descriptor/services.go.TestOptionalProto3URLPathMappingErrortoTestOptionalProto3URLPathMappingSuccessininternal/descriptor/services_test.go.additional_bindingto theCustomRPC inexamples/internal/proto/examplepb/a_bit_of_everything.protousing an optional path parameter to prove end-to-end generation success.