Skip to content

Conversation

navinger
Copy link
Contributor

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.

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.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 29, 2018
@lesv
Copy link
Contributor

lesv commented Mar 29, 2018

------------------------------------------------------------
- testing endpoints/getting-started
------------------------------------------------------------
[ERROR] src/main/java/com/example/endpoints/EchoServlet.java:[1] (header) RegexpHeader: Line does not match expected header line of '^\W+\*?\W*Copyright 20\d\d Google Inc.$'.
[ERROR] src/main/java/com/example/endpoints/AuthInfoServlet.java:[1] (header) RegexpHeader: Line does not match expected header line of '^\W+\*?\W*Copyright 20\d\d Google Inc.$'.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (default) on project endpoints: You have 2 Checkstyle violations. -> [Help 1]

@lesv
Copy link
Contributor

lesv commented Mar 29, 2018

@dzlier-gcp Could you help Nancy w/ this.
@kurtisvg it looks good to me -- not sure why it's not passing.

@kurtisvg
Copy link
Contributor

@lesv It's complaining about two files that aren't changed in the diff. This project must be one that we decided not to run tests on.

@kurtisvg kurtisvg mentioned this pull request Mar 29, 2018
navinger and others added 2 commits March 29, 2018 13:54
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.
@kurtisvg kurtisvg merged commit e4cc47a into GoogleCloudPlatform:master Mar 29, 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.

4 participants