Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Compute API v1: xxxResourceName.parse throws ValidationException #3604

Copy link
Copy link

Description

@dtretyakov
Issue body actions

Currently all parse() methods in xxxResourceName classes expect that input string will be formatted like projects/{project}/..., but data returned from APIs contains URL prefixes like https://www.googleapis.com/compute/v1/projects/... and as result parsing fails with ValidationException.

Example

Receive instance details where:

instance.zone = https://www.googleapis.com/compute/v1/projects/project-123/zones/europe-west3-c

Then when trying to parse it with ProjectZoneName.parse(instance.zone) will cause the following exception:

ProjectZoneName.parse: formattedString not in valid format: Parameter "https://www.googleapis.com/compute/v1/projects/project-123/zones/europe-west3-c" must be in the form "projects/{project=*}/zones/{zone=*}"
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

api: computeIssues related to the Compute Engine API.Issues related to the Compute Engine API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.