-
Notifications
You must be signed in to change notification settings - Fork 6k
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
How to create static javascript api #78
Comments
Hi, currently there is no static javascript generator, but you could certainly create one. I'll leave this open as a feature, but sorry, there isn't a generator right now. |
will address in the 2.1.0-M2 milestone |
It looks like this probably fell out of scope at some point. My team would really love to see this working (as well as an Angular $resource based generator). |
@jdhiro I wrote something to do this a while back. But it's a bit intertwined in other code and I never bothered to extract it. Also, I just used the $http service directly, not $resource. Recently been wondering if swagger-codgen supports static javascript yet and come across this link, have you tried it? https://github.com/wcandillon/swagger-js-codegen |
I've written an npm package that can accomplish the original intent of this ticket: https://www.npmjs.com/package/swagger-client-standalone This package builds all of the NPM dependencies, the swagger spec, and swagger client all into one JS file. I use it in places where I can only use UMD-style includes. Because modular javascript doesn't work well in UMD environments, I opted to bundle it together. |
Good lord, I just realized that this approach is adding over 300kb to my library. That is not an option. |
@jfiala has created a JS API client generator, which has been merged into master. Please pull the latest master and give it a try. |
Hi,
We like to create static javascript api using swagger. We tried with node.js implementation but we didn't succeeded in the browser.
I need something like ./bin/runscala.sh com.wordnik.swagger.codegen.BasicJSGenerator http://petstore.swagger.wordnik.com/api/resources.json
I know a runtime support for javascript is there , but I prefer a static api geneartion.
Any advice is very helpful.
The text was updated successfully, but these errors were encountered: