From dd4f46f1689a338bc9204913d59a29a4afa11de2 Mon Sep 17 00:00:00 2001 From: navinger Date: Thu, 29 Mar 2018 12:21:18 -0700 Subject: [PATCH 1/3] Remove basePath: "/" I'm updating all the openapi files in the getting-started sample in all the sample repos to remove basePath: "/" Here's the reason from simonz130: From the OpenAPI 2 spec: * basePath: "If it is not included, the API is served directly under the host. The value MUST start with a leading slash (/). " * Paths for methods: "A relative path to an individual endpoint. The field name MUST begin with a slash. The path is appended to the basePath in order to construct the full URL." This OpenAPI getting-started sample have basePath: "/", which (per strict spec interpretation) means all the paths start with double-slashes. (e.g "//v1/shelves" rather than "/v1/shelves"). Removing basepath="/" fixes that. --- endpoints/getting-started/openapi.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/endpoints/getting-started/openapi.yaml b/endpoints/getting-started/openapi.yaml index 1fb65f54bd0..b0a9f31946e 100644 --- a/endpoints/getting-started/openapi.yaml +++ b/endpoints/getting-started/openapi.yaml @@ -20,7 +20,6 @@ info: version: "1.0.0" host: "echo-api.endpoints.YOUR-PROJECT-ID.cloud.goog" # [END swagger] -basePath: "/" consumes: - "application/json" produces: From 9ee07536c6f8592bcbfe75393c6d680479c2d7b3 Mon Sep 17 00:00:00 2001 From: navinger Date: Thu, 29 Mar 2018 12:22:23 -0700 Subject: [PATCH 2/3] Remove basePath: "/" I'm updating all the openapi files in the getting-started sample in all the sample repos to remove basePath: "/" Here's the reason from simonz130: From the OpenAPI 2 spec: * basePath: "If it is not included, the API is served directly under the host. The value MUST start with a leading slash (/). " * Paths for methods: "A relative path to an individual endpoint. The field name MUST begin with a slash. The path is appended to the basePath in order to construct the full URL." This OpenAPI getting-started sample have basePath: "/", which (per strict spec interpretation) means all the paths start with double-slashes. (e.g "//v1/shelves" rather than "/v1/shelves"). Removing basepath="/" fixes that. --- endpoints/getting-started/openapi-appengine.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/endpoints/getting-started/openapi-appengine.yaml b/endpoints/getting-started/openapi-appengine.yaml index 21b77deac75..a22beac89c2 100644 --- a/endpoints/getting-started/openapi-appengine.yaml +++ b/endpoints/getting-started/openapi-appengine.yaml @@ -20,7 +20,6 @@ info: version: "1.0.0" host: "YOUR-PROJECT-ID.appspot.com" # [END swagger] -basePath: "/" consumes: - "application/json" produces: From 1565a6f3400468021918d4abda49f9c3463e00c9 Mon Sep 17 00:00:00 2001 From: Kurtis Van Gent Date: Thu, 29 Mar 2018 13:57:27 -0700 Subject: [PATCH 3/3] Update headers for checkstyle. --- .../src/main/java/com/example/endpoints/AuthInfoServlet.java | 3 ++- .../src/main/java/com/example/endpoints/EchoServlet.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/endpoints/getting-started/src/main/java/com/example/endpoints/AuthInfoServlet.java b/endpoints/getting-started/src/main/java/com/example/endpoints/AuthInfoServlet.java index 88cc789bf19..bb59969e41a 100644 --- a/endpoints/getting-started/src/main/java/com/example/endpoints/AuthInfoServlet.java +++ b/endpoints/getting-started/src/main/java/com/example/endpoints/AuthInfoServlet.java @@ -1,4 +1,4 @@ -/** +/* * Copyright 2015 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,6 +14,7 @@ * limitations under the License. */ + package com.example.endpoints; import com.google.gson.Gson; diff --git a/endpoints/getting-started/src/main/java/com/example/endpoints/EchoServlet.java b/endpoints/getting-started/src/main/java/com/example/endpoints/EchoServlet.java index 729d14e7687..84e3152f404 100644 --- a/endpoints/getting-started/src/main/java/com/example/endpoints/EchoServlet.java +++ b/endpoints/getting-started/src/main/java/com/example/endpoints/EchoServlet.java @@ -1,4 +1,4 @@ -/** +/* * Copyright 2015 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License");