-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove servers urls with trailing slash #7940
Remove servers urls with trailing slash #7940
Conversation
Hi everyone |
Hi everyone |
Any updates on this? |
Hi - this is holding back our major release, if you could be so kind to give this PR some love it would be greatly appreciated. Thanks! |
Can you please add tests showing this code working for the use cases that you are concerned about? |
I ve just added test |
Hi - I was wondering if we could get a ship on this - we are pretty behind on the release and any help would be greatly appreciated. Thanks so much in advance! |
Closing an re-opening to kick off CI tests. |
@ksvirkou-hubspot there is a CI error here: |
I updated the test to be in the java layer as this change impacts all generators |
url: https://www.apache.org/licenses/LICENSE-2.0.html | ||
version: 1.0.0 | ||
servers: | ||
- url: / |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per @jimschubert
Server with no url base specified is meant to be the same server where the spec doc was downloaded from.
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#server-object:
REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in {brackets}.
So we should only do this stripping if the length is > 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm when we keep this value as '/' rust tests fail because they assume that we keep stripping the / from the end of the server url. Probably better to keep removing it and have future PRs detect the "" use case if they need to. That way this is non-breaking.
Closing and re-opening for travis |
Hey everyone |
Closing and re-opening for travis |
@ksvirkou-hubspot can you help get tests passing?
Are you okay with it?
|
@@ -1483,4 +1484,8 @@ private void generateFilesMetadata(List<File> files) { | |||
} | |||
} | |||
|
|||
private String removeTrailingSlash(String value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should pass in a boolean doNotModifyOnlySlash and when it is true, for "/" leave it as-is?
That we we could use it to preserve the current behavior here for rust jersey-2 etc.
cc @OpenAPITools/generator-core-team as there are changes to the default generator |
Fixed issue #7533
I see it in every language
./bin/generate-samples.sh
to update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH.master