-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Clean up file output handling #1895
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
Conversation
This attempts to normalize all generators to use OS agnostic File.separator. It also cleans up some areas in code where we replace "." in full file output path with File.separator. We should only be modifying directory names we own, and should avoid modifying anything that can be provided by a user. It would probably be better to use Paths.get(…).toString() in all cases.
This should fix #1834. |
@jimschubert thanks for the PR. I'll review later today. Have a nice weekend. |
@wing328 no problem. I've fixed merge conflicts. To repro #1834, you can use |
It seems the issue that fixed in #1863 occurs again. 👀 |
and here are the errors reported by Travis (and other CIs):
|
Sorry about that. I merged in master to fix the file conflicts and it introduced another path replacement and groupings ended up shifting during merge. I'm currently needing to push to remote in order to have tests run, because after evaluating the Guava issue with Android Gradle Plugin, the test suite locks up on my machine. |
Last commit should fix the shippable issue for Windows. I have concerns that a user on Windows would never provide a path like |
As mentioned above, and discussed in chat, I've used This resolves an issue, for instance when you do |
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.
Cool! LGTM ✨
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.
LGTM
* Clean up file output handling This attempts to normalize all generators to use OS agnostic File.separator. It also cleans up some areas in code where we replace "." in full file output path with File.separator. We should only be modifying directory names we own, and should avoid modifying anything that can be provided by a user. It would probably be better to use Paths.get(…).toString() in all cases. * Fix missed path separators in java codegen * Adjust Java codegen path replacements * Convert / in full path replacements, as / is forbidden in Windows, and noop elsewhere * Use Paths.get where files are written, to better handle Windows path constraints
This should fix an issue where output path names containing . were not being interpretted properly REFERENCE: OpenAPITools/openapi-generator#1895
This should fix an issue where output path names containing . were not being interpretted properly REFERENCE: OpenAPITools/openapi-generator#1895
This attempts to normalize all generators to use OS agnostic
File.separator.
It also fixes a bug in some areas in code where we replace "." in full file
output path with File.separator. We should only be modifying directory
names we own, and should avoid modifying anything that can be provided
by a user.
It would probably be better to use Paths.get(…).toString() in all cases.
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,. Default:3.4.x
,4.0.x
master
.