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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a problem that points to a folder that doesn't exist #1863

Merged
merged 4 commits into from Jan 11, 2019

Conversation

Projects
None yet
3 participants
@ackintosh
Copy link
Member

ackintosh commented Jan 9, 2019

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./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\.
  • Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

When working directory contains . , we can see following error:

$ pwd
/Users/akihito.nakano/src/github.com/ackintosh/openapi-generator-1/
$ ./bin/java-petstore-feign.sh
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/akihito/nakano/src/github/com/ackintosh/openapi-generator-1/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java
Exception in thread "main" java.lang.RuntimeException: Could not generate model 'AdditionalPropertiesClass'
        at org.openapitools.codegen.DefaultGenerator.generateModels(DefaultGenerator.java:509)
        at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:904)
        at org.openapitools.codegen.cmd.Generate.run(Generate.java:354)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:61)
Caused by: java.io.FileNotFoundException: /Users/akihito/nakano/src/github/com/ackintosh/openapi-generator-1/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java (No such file or directory)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
        at org.openapitools.codegen.AbstractGenerator.writeToFile(AbstractGenerator.java:49)
        at org.openapitools.codegen.DefaultGenerator.processTemplateToFile(DefaultGenerator.java:946)
        at org.openapitools.codegen.DefaultGenerator.generateModel(DefaultGenerator.java:322)
        at org.openapitools.codegen.DefaultGenerator.generateModels(DefaultGenerator.java:498)
        ... 3 more
mkdir: samples/client/petstore/java/feign/src/test/java/org/openapitools/client: File exists

Caused by: java.io.FileNotFoundException: /Users/akihito/nakano/src/github/com/ackintosh/openapi-generator-1/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java (No such file or directory)

The output points to invalid folder, the dots in the folder path has replaced with slash. 馃檮

@ackintosh ackintosh added the Issue: Bug label Jan 9, 2019

@ackintosh ackintosh added this to the 4.0.0 milestone Jan 9, 2019

Run ensure-up-to-date script
./bin/utils/ensure-up-to-date
@ackintosh

This comment has been minimized.

Copy link
Member

ackintosh commented Jan 10, 2019

cc @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01)

@wing328
Copy link
Member

wing328 left a comment

Thanks for the fix, which looks good to me.

@wing328 wing328 merged commit 4652023 into OpenAPITools:master Jan 11, 2019

4 checks passed

Shippable Run 5157 status is SUCCESS.
Details
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ackintosh ackintosh deleted the ackintosh:fix-javaclient-output-folder branch Jan 12, 2019

jimschubert added a commit that referenced this pull request Jan 12, 2019

Merge branch 'master' into fix-path-cleaning-on-write
* master:
  Add links to Patreon account (#1887)
  Python AIOHTTP server generator (#1470)
  Fix a problem that points to a folder that doesn't exist (#1863)
  Python: Update api_doc_example for multiple auth (#1870)
  [gradle] Add 4 boolean properties supported by codegenConfigurator (#1881)
@jimschubert

This comment has been minimized.

Copy link
Member

jimschubert commented Jan 12, 2019

also related to #1834

UkuLoskit added a commit to UkuLoskit/openapi-generator that referenced this pull request Jan 20, 2019

Fix a problem that points to a folder that doesn't exist (OpenAPITool鈥
鈥#1863)

* Add test case that reproduce issues

* Fix a problem that points to a folder that doesn't exist

* Improves for windows

* Run ensure-up-to-date script

./bin/utils/ensure-up-to-date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment