-
Notifications
You must be signed in to change notification settings - Fork 48
feat: add ability to echo headers & sample routing annotations on echo method #970
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
Conversation
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
noahdietz
reviewed
Jan 14, 2022
Collaborator
noahdietz
left a comment
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.
Looks great.
noahdietz
approved these changes
Jan 18, 2022
Collaborator
noahdietz
left a comment
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'm happy with this. I will let you, @alicejli decide if you want eyes from the other reviewers.
…apis#973) [](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/google/go-cmp](https://github.com/google/go-cmp) | require | patch | `v0.5.6` -> `v0.5.7` | --- ### Release Notes <details> <summary>google/go-cmp</summary> ### [`v0.5.7`](https://github.com/google/go-cmp/releases/v0.5.7) [Compare Source](https://github.com/google/go-cmp/compare/v0.5.6...v0.5.7) Reporter changes: - ([#​266](https://github.com/google/go-cmp/issues/266)) Fix textual printing of byte slices - ([#​275](https://github.com/google/go-cmp/issues/275)) Reduce minimum length for specialize string diffing - ([#​276](https://github.com/google/go-cmp/issues/276)) Use any alias instead of interface{} Code cleanup changes: - ([#​281](https://github.com/google/go-cmp/issues/281)) Update minimum supported version to go1.11 - ([#​282](https://github.com/google/go-cmp/issues/282)) Drop hacks to work around Go reflection bugs in Go1.9 - ([#​285](https://github.com/google/go-cmp/issues/285)) Add //go:build lines - ([#​262](https://github.com/google/go-cmp/issues/262)) Fix staticcheck findings - ([#​263](https://github.com/google/go-cmp/issues/263)) Avoid shadowing variable - ([#​268](https://github.com/google/go-cmp/issues/268)) Use sha256 in test - ([#​271](https://github.com/google/go-cmp/issues/271)) Fix spelling mistakes - ([#​269](https://github.com/google/go-cmp/issues/269)) Change build status badge </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-showcase).
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.
As part of supporting dynamic routing annotations per
google/api/routing.proto, this adds the following:Echo.EchomethodEchoservice to echo the contents set with thex-goog-request-paramsmetadata key to the response headersAn example of how to set and read the headers in Go:
The result should be:
Each language microgenerator can use the following sample tests to the
Echomethod to confirm the dynamic routing annotations are being generated properly.EchoRequest without
headerorother_headerfield specifiedHeader should be empty.
Expected Header:
baz=waldoExpected Header:
routing_id=foo&header=fooExpected Header:
routing_id=projects/foo&header=projects/fooExpected Header:
instance_id=instances/quuz&table_name=projects/foo/instances/quuz/rows&header&super_id=projects/foo&routing_id=projects/foo/instances/quuz/rows&header=projects/foo/instances/quuz/rowsExpected Header:
table_name=regions/foo/zones/bar/rows&routing_id=regions/foo/zones/bar/rows&header=regions/foo/zones/bar/rowsExpected Header:
super_id=projects/foo&routing_id=projects/foo/instances/bar&header=projects/foo/instances/barExpected Header:
quz=projects/foo&baz=projects/foo/instances/bar&routing_id=thud&header=thud