Coder Social home page Coder Social logo

Comments (8)

fehguy avatar fehguy commented on May 22, 2024

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.

from swagger-codegen.

fehguy avatar fehguy commented on May 22, 2024

will address in the 2.1.0-M2 milestone

from swagger-codegen.

jdhiro avatar jdhiro commented on May 22, 2024

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).

from swagger-codegen.

mozey avatar mozey commented on May 22, 2024

@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

from swagger-codegen.

who avatar who commented on May 22, 2024

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.

from swagger-codegen.

jdhiro avatar jdhiro commented on May 22, 2024

@mozey I haven't tried that project yet, but I was going to. They don't support $resource yet either.

@who Yeah, I'm making a library/SDK, so I'm basically just doing a require('swagger.json') and bundling it all up. This really just makes the runtime library superfluous though.

from swagger-codegen.

jdhiro avatar jdhiro commented on May 22, 2024

Good lord, I just realized that this approach is adding over 300kb to my library. That is not an option.

from swagger-codegen.

wing328 avatar wing328 commented on May 22, 2024

@jfiala has created a JS API client generator, which has been merged into master. Please pull the latest master and give it a try.

from swagger-codegen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.