Remove servers urls with trailing slash#7940
Remove servers urls with trailing slash#7940wing328 merged 9 commits intoOpenAPITools:masterfrom ksvirkou-hubspot:bug/pythonTrailingSlash
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.
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.
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?
|
| } | ||
| } | ||
|
|
||
| private String removeTrailingSlash(String value) { |
There was a problem hiding this comment.
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.shto 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