Skip to content

Commit

Permalink
fix: correct overzealous locations search string (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdietz committed Aug 30, 2021
1 parent dfea121 commit 80272bb
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ApiVersionedDir {

private static String CLOUD_AUTH_SCOPE = "https://www.googleapis.com/auth/cloud-platform";

private static String LOCATIONS_MIXIN = "google.cloud.location.Locations";
private static String LOCATIONS_MIXIN = "name: google.cloud.location.Locations";

private static final String[] PRESERVED_PROTO_LIBRARY_STRING_ATTRIBUTES = {
// TypeScript:
Expand Down Expand Up @@ -283,7 +283,9 @@ void parseYamlFile(String fileName, String fileBody) {
this.cloudScope = fileBody.contains(CLOUD_AUTH_SCOPE);

// API Serivce config has Locations API.
this.containsLocations = fileBody.contains(LOCATIONS_MIXIN);
if (fileBody.contains(LOCATIONS_MIXIN)) {
this.containsLocations = true;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ java_gapic_library(
srcs = [":library_proto_with_info"],
gapic_yaml = None,
grpc_service_config = "library_example_grpc_service_config.json",
service_yaml = "//google/example/library:library_example_v1.yaml",
service_yaml = "library_example_v1.yaml",
test_deps = [
":library_java_grpc",
"//google/cloud/location:location_java_grpc",
Expand Down Expand Up @@ -131,7 +131,7 @@ go_gapic_library(
srcs = [":library_proto_with_info"],
grpc_service_config = "library_example_grpc_service_config.json",
importpath = "cloud.google.com/go/example/library/apiv1;library",
service_yaml = "//google/example/library:library_example_v1.yaml",
service_yaml = "library_example_v1.yaml",
metadata = True,
deps = [
":library_go_proto",
Expand Down Expand Up @@ -207,7 +207,7 @@ php_gapic_library(
name = "library_php_gapic",
srcs = [":library_proto_with_info"],
grpc_service_config = "library_example_grpc_service_config.json",
service_yaml = "//google/example/library:library_example_v1.yaml",
service_yaml = "library_example_v1.yaml",
deps = [
":library_php_grpc",
":library_php_proto",
Expand Down Expand Up @@ -240,7 +240,7 @@ nodejs_gapic_library(
extra_protoc_parameters = ["metadata"],
grpc_service_config = "library_example_grpc_service_config.json",
package = "google.example.library.v1",
service_yaml = "//google/example/library:library_example_v1.yaml",
service_yaml = "library_example_v1.yaml",
deps = [],
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

type: google.api.Service
config_version: 3
name: library-example.googleapis.com
title: Example Library API

apis:
- name: google.example.library.v1.LibraryService
- name: google.cloud.location.Locations

documentation:
summary: A simple Google Example Library API.
overview: |-
# Introduction
This is a Google example service representing a simple digital library. It
manages a collection of shelf resources, and each shelf owns a collection of
book resources.
backend:
rules:
- selector: google.example.library.v1.LibraryService.CreateShelf

authentication:
rules:
- selector: 'google.example.library.v1.LibraryService.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform

0 comments on commit 80272bb

Please sign in to comment.