Skip to content
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

Javascript client codegen useES6 and templates #5845

Closed
kevin-lot opened this issue Jun 14, 2017 · 10 comments
Closed

Javascript client codegen useES6 and templates #5845

kevin-lot opened this issue Jun 14, 2017 · 10 comments

Comments

@kevin-lot
Copy link

kevin-lot commented Jun 14, 2017

Description

Javascript client codegen doesn't use my own templates when useES6 additionnal properties is setted.

Swagger-codegen version

2.3.0
pull at june 14, 2017

Command line used for generation

java \
-DdebugModels \
-DdebugOperations \
-jar ./generator/swagger-codegen-cli.jar \
generate \
-i ../swagger.json \
-l javascript \
-o ./ \
--additional-properties useInheritance=true,useES6=true \
-t ./generator/templates/javascript-es6 \
> ./.mustache.log

Steps to reproduce

Use templates with useES6 additional properties.

@wing328
Copy link
Contributor

wing328 commented Jun 18, 2017

Your usage of -t with customized templates should work. Not sure why it's not working for you.

Can you share a bit more on what you want to customize?

You may want to also try without the useES6 option to see if it makes any difference.

@kevin-lot
Copy link
Author

-t ./generator/templates/javascript-es6 is the path of my own template.

When I put "us6=true" in command, generics template from codegen are used.
When I don't put "us6=true" in command , my own templates are used.

My templates work with isomorphicFetch and are completely rewrote.

@wing328
Copy link
Contributor

wing328 commented Jun 26, 2017

@kevin-lot I did fix some minor issues with the Javascript generator and would suggest you to pull the latest master to see if you're still experiencing the same issue.

@kevin-lot
Copy link
Author

kevin-lot commented Jun 28, 2017

@wing328
OK, you did something.

With the latest branch 2.30, pulled at june 28, 2017

Now, with or without the additionnal parameter "useES6", generic template from codegen are used. The "-t" parameter is completely ignored.

@wing328
Copy link
Contributor

wing328 commented Jun 28, 2017

I'll look into the issue with the -t parameter support for JS generator tomorrow.

If you run bin\windows\javascript-petstore.bat on Windows or ./bin/javascript-petstore.sh (Mac/Linux), do you see any code changes in the JS ES5 Petstore samples?

@wing328 wing328 modified the milestones: v2.3.0, v2.2.3 Jul 16, 2017
@lukket
Copy link

lukket commented Aug 7, 2017

Any news here?

We had to update from v2.2.2 to v2.2.3 because of #4932. But now or CI is broken because the code generator for JavaScript seems to ignore all templates. Thus, the default package.json is used and new packages cannot be published anymore.

wing328 added a commit that referenced this issue Aug 7, 2017
@wing328
Copy link
Contributor

wing328 commented Aug 7, 2017

@kevin-lot @lkettenb I've filed #6253 to fix it. Will merge it into master after the CI tests pass.

wing328 added a commit that referenced this issue Aug 7, 2017
* fix #5845 (template dir)

* fix js petstore test case
@wing328
Copy link
Contributor

wing328 commented Aug 7, 2017

The fix has been merged into master. Please pull the latest master to give it a try.

@lukket
Copy link

lukket commented Aug 8, 2017

@wing328 Thank you very much! It seems to work again!

@wing328
Copy link
Contributor

wing328 commented Aug 8, 2017

@lkettenb np. Sorry for taking this long as I lost track of this issue.

If you've further feedback on the JS API client, please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants