Skip to content

Update compute_gapic.yaml (WIP) - #95

Closed
andreamlin wants to merge 1 commit into
googleapis:masterfrom
andreamlin:compute_gapic_update
Closed

andreamlin wants to merge 1 commit into
googleapis:masterfrom
andreamlin:compute_gapic_update

Conversation

@andreamlin

@andreamlin andreamlin commented Nov 2, 2018 •

Copy link
Copy Markdown
Contributor

Generated with googleapis/gapic-generator#2402.

Diff will be simpler after #96 gets checked in. edit: diffbase checked into master

Testing: Regenerated Java google-cloud-compute client with this refreshed compute_gapic.yaml, and there were 0 changes in the Java client code.

@andreamlin
andreamlin force-pushed the compute_gapic_update branch from 5cdef0d to a536f0a Compare November 5, 2018 18:21
andreamlin added a commit to googleapis/gapic-generator that referenced this pull request Dec 11, 2018
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.
@andreamlin andreamlin closed this Dec 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants