-
Notifications
You must be signed in to change notification settings - Fork 99
test: verify synthetic fields are skipped #2393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
coryan
merged 1 commit into
googleapis:main
from
coryan:test-skip-synthetic-fields-in-serde
Jun 8, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am late to the party and confused. I read:
google-cloud-rust/generator/internal/api/model.go
Lines 505 to 508 in 56d472f
So these synthetic fields are part of the path we would use to make the RPC, not part the request? That makes sense. But don't things work the same way with gRPC transcoding?
Hmm, I thought fields in the path need not be repeated in the body (even when the body is
*). But I don't see that stated in https://google.aip.dev/127.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, 2.4.2 in go/actools-regapic-grpc-transcoding says fields from the path should not be included in the body, but this is optional. So what we are doing is fine.
Still the way this is unified feels weird to me. Seems like we could serialize the fields, even if they are synthetic. But then in the
transport.rslayer, we couldstd::mem::takethe fields out of the request for use in the path.Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OpenAPI needs a lot of work in this area.
I do not think we can, because (sometimes) they do not match any existing field in the original request.
Consider this:
google-cloud-rust/src/generated/openapi-validation/src/model.rs
Lines 3563 to 3590 in 56d472f
The synthetic fields are
project,locationandsecret_id. That is all the info we have in the source specification:google-cloud-rust/testdata/secretmanager_openapi_v1.json
Lines 462 to 488 in 56d472f
If we wanted to include them in the body we should be sending
secret_idandparent:https://github.com/googleapis/googleapis/blob/1804a603281707a1f0e6fff27851cae115ac3c8b/google/cloud/secretmanager/v1/service.proto#L65-L68
https://github.com/googleapis/googleapis/blob/1804a603281707a1f0e6fff27851cae115ac3c8b/google/cloud/secretmanager/v1/service.proto#L322-L343
But we do not even know the original name of the (decomposed)
projectandlocationfields.