Code Monkey home page Code Monkey logo

openapi-typescript-client-api-generator's People

Contributors

michaelhilus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

openapi-typescript-client-api-generator's Issues

Fails on petstore.json service generation

Using this cannonical json file
https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v2.0/json/petstore.json

The code generation fails

I suspect because the base service specification is mandatory - it's probably my own fault -
but I need some sample base service so that this code generation succeeds.

./generate.sh
yarn run v1.17.3
$ openapi-typescript-client-api-generator -c petstore.json -sb /client/services -s /client/api/services -m /client/api/models -sm /server/modules/api/models
InStage client api generator
Loading config file...
Config file with version 2.0 found.
Running converter...
Converted.
Augmenting config with server models...
Loaded 0 server models.
Added 0 server models to the configuration.
Config file loaded.
Loading api info...
Done.
Loading models...
Loaded 3 models.
Generating model files...
Generated 3 model files.
Loading request bodies...
Loaded 0 request bodies.
Generating request body files...
Generated 0 request body files.
(node:40147) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
at servicesLoader (/Users/admin/Documents/8secondz-workspace/8secondz-axios/node_modules/@progresso/openapi-typescript-client-api-generator/loaders/servicesLoader.js:5:30)
at generate (/Users/admin/Documents/8secondz-workspace/8secondz-axios/node_modules/@progresso/openapi-typescript-client-api-generator/index.js:48:22)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:40147) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:40147) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
โœจ Done in 0.22s.

N.B. there are some models spat out successfully.

/**
 * Swagger Petstore 1.0.0 (OpenAPI: 3.0.0)
 * 
 *
 * NOTE: This class is auto generated by openapi-typescript-client-api-generator.
 * Do not edit the file manually.
 */

export class Pet {
    public id: number;

    public name: string;

    public tag: string;

    /**
     * Creates a Pet.
     *
     * @param {number} id
     * @param {string} name
     * @param {string} tag
     */
    constructor(id: number, name: string, tag: string) {
        this.id = id;
        this.name = name;
        this.tag = tag;
    }
}

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.