This repository has been archived by the owner on Jun 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Conversation
This file contains 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
Partially addresses googleapis/google-cloud-java#3604. Don't force pathtemplate strings to start with a literal string. The status quo, for path templates, is to magically append a literal string to templated paths that begin with a bracketed string, e.g. the path {project}/zones/{zone} is rendered as projects/{project}/zones/{zone}. I don't remember exactly why we decided to do this, though it may have been related to purity of usage of PathTemplates, where all existing Google grpc path templates start with a projects (or possibly organizations) substring. More importantly, this PR allows us to parse a resource string returned from the server (see issue googleapis/google-cloud-java#3604), which often looks like https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}. The compute.v1.json Discovery API specifies that the baseUrl is exactly https://www.googleapis.com/compute/v1/projects. We can then take a resource string from the server, remove the given baseUrl prefix, and then parse the remaining suffix {project}/zones/{zone} into a ProjectsZoneName. See googleapis/google-cloud-java#3899 and googleapis/discovery-artifact-manager#95 for the resulting surface diffs from this generator change.
This was referenced Dec 11, 2018
@pongad PTAL |
pongad
approved these changes
Dec 13, 2018
Codecov Report
@@ Coverage Diff @@
## master #2478 +/- ##
============================================
+ Coverage 86.77% 86.77% +<.01%
Complexity 5367 5367
============================================
Files 459 459
Lines 21186 21183 -3
Branches 2309 2308 -1
============================================
- Hits 18384 18382 -2
Misses 1975 1975
+ Partials 827 826 -1
Continue to review full report at Codecov.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes googleapis/google-cloud-java#3604.
All these changes have already been reviewed in #2474 and #2402; now I would like to merge these changes into the master branch (they were previously only merged onto the branch
origin/fix_compute_resource_parsing
).This PR is used to generate googleapis/google-cloud-java#4213 and googleapis/discovery-artifact-manager#102. All three of these PR will have to be signed off, and then we can merge them all around at the same time. (First we would merge the discovery-artifact-manager PR so that the CircleCI job compute-discovery-test will pass).