GithubHelp home page GithubHelp logo

Comments (3)

justonian avatar justonian commented on August 24, 2024

As an FYI, this gulp task and feature isn't officially documented in the repo since it was for the developers of the project only. If you'd like to get it to work, first install Swagger-Codegen locally as described at https://github.com/swagger-api/swagger-codegen. I believe you already have this working. Next, you should be able to run "gulp generate_sdk" when in the API directory and successfully generate a new SDK folder and sub-files from the Swagger definition YAML file.

As you mentioned, between Angular 4 changes and Swagger Codegen changes, the signatures for some of the initialization options have changed, with an optional configuration. I just pushed a commit to update the project to use the latest generated SDK and pass in a null for the configuration options, which are optional.

Additionally, Angular 4 made some changes to their HTTP service to have an enum instead of a string for the HTTP methods, so I've updated the spacefinder-api-service.ts file accordingly, to properly handle this.

All should be working fine now with the latest Swagger Codegen, Ionic, and Angular 4 so let me know if you run into other issues.

Justin

from aws-serverless-auth-reference-app.

rakeshtembhurne avatar rakeshtembhurne commented on August 24, 2024

Thank you @justonian for detailed explanation. While studying this project, I went to the code and found this really nice feature gulp generate_sdk - to build api just from swagger definition file.

I later found that the problem was with version of swagger-codegen. I installed it with Homebrew package manager and the version installed was v2.2.3. After spending few hours on it, I found that actual version should have been v2.2.1. So I downloaded old jar file and made following changes to the api/util/swagger.js file.

-    let cmd = spawn('swagger-codegen', ['generate', '-i', swaggerDir + '/SpacefinderAPI-exported.yml', '-l', 'typescript-angular2', '-o', apiSdkDir]);
+    let cmd = spawn('java', ['-jar', '/path/to/my/swagger-codegen-cli-2.2.1.jar', 'generate', '-i', swaggerDir + '/SpacefinderAPI-exported.yml', '-l', 'typescript-angular2', '-o', apiSdkDir]);

These changes worked for me.

from aws-serverless-auth-reference-app.

justonian avatar justonian commented on August 24, 2024

Try again now with the latest version. I did have to make a few updates the other day to support it given their new initialization signature, but those are now made and pushed to this repo.

If you download the latest code from this repo and try it with the latest swagger codegen version, it should work fine now.

from aws-serverless-auth-reference-app.

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.