-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Fix relative url as basePath #10057
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
Fix relative url as basePath #10057
Conversation
|
Push |
|
Can you add some tests for it? |
|
@agilob sorry for the late response. just added a test as you requested |
| } | ||
| } | ||
|
|
||
| public static boolean isRelativeUrl(List<Server> servers) { |
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.
replace tabs with spaces
| } | ||
|
|
||
| public static boolean isRelativeUrl(List<Server> servers) { | ||
| if (servers.size() > 0) { |
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.
can servers be null or empty?
| } | ||
|
|
||
| @Test | ||
| public void testHandlesRelativeUrlsInServers() { |
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.
method configureGeneratorProperties is package protected, you didn't need to write this whole test with setup of new yaml file
|
just a note: You didn't need to create new yaml to test |
ok so how would you write this test? i just adopted the test closest to my issue |
|
Are there any open tasks? |
modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java
Outdated
Show resolved
Hide resolved
Fix lines change tabs to spaces
|
are there any open tasks? |
|
issue #10056 |
|
@agilob can we merge that pr. i still have to patch this bug to use this generator |
|
cc @wing328 |
|
Let me try to review and merge this weekend. Sorry for the delay as there are too many PRs. |
|
When the server URL consists of a single slash, i.e. |
fixes #2731
fixes #8576
fixes #10697
fixes #10056
PR checklist
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,5.3.x,6.0.x