Manweill / swagger-axios-codegen

swagger client to use axios and typescript
MIT License
306 stars 83 forks source link

Adds support of primitive response types #5

Closed kt81 closed 6 years ago

kt81 commented 6 years ago

In some cases, we want to use primitive type as just a response data (string, boolean or number).

Example:

// definition of the api "/ping"
{
  // ...
  responses: {
    200: {
      description: "Success",
        schema: {
          type: "string",
          example: "pong"
        }
     }
  }
  // ...
}

At present, a definition like below generates Primitive<any> return value. This PR handles such a case.

kt81 commented 6 years ago

Thank you!