Code Monkey home page Code Monkey logo

openapi's People

Contributors

bithooked avatar hodgreeley avatar singanur avatar subrah1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

openapi's Issues

Typescript-fetch incompatibility: duplicate exports

When using OpenAPIGenerator* and this swagger.yaml file to generate a typescript-fetch sdk, the generated sdk will not compile because of the following errors:

> npx tsc --listEmittedFiles

yodlee/yodlee-api/models/index.ts:155:1 - error TS2308: Module './Transaction' has already exported a member named 'TransactionCategorySourceEnum'. Consider explicitly re-exporting to resolve the ambiguity.

155 export * from './TransactionCategory';
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

yodlee/yodlee-api/models/index.ts:155:1 - error TS2308: Module './Transaction' has already exported a member named 'TransactionCategoryTypeEnum'. Consider explicitly re-exporting to resolve the ambiguity.

155 export * from './TransactionCategory';
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is because in swagger.yaml Transaction is defined as an object with enum 'categoryType' and TransactionCategory is defined as an object with enum 'type'. Values for these fields are both codegen'ed into TransactionCategoryTypeEnum, leading to a naming conflict. (same goes for source).

Coincidentally, these enums contain the same values, meaning there is no runtime problem at present. However, I'm not sure whether this is guaranteed to remain the case.

To the extent that these enums will remain the same, can they be refactored into a new definition and/or can exporting guidance be updated? (For example, maybe the fix is to manually edit index.ts to arbitrarily pick one of the identical definitions?

To the extent that they are not guaranteed to be the same, can they be renamed such that they do not conflict?

Thanks!

*I did first try to use Swagger.io and even Swagger-codegen to generate my SDK's per yodlee's guidance but ran into worse problems than this- that repo is much less maintained.

Format for date-time missing across API spec

The OpenAPI 2.0 specification allows for data types such as date-time to enhance the basic types. Adding this data will make generated clients much more useful, for example:

  ClientCredentialToken:
    type: "object"
    title: "ClientCredentialToken"
    properties:
      expiresIn:
        format: "int32"
        description: "Time in seconds after which the issued accessToken expires.<br><br><b>Endpoints</b>:<ul><li>POST /auth/token</li></ul>"
        readOnly: true
        type: "integer"
      issuedAt:
        description: "The date and time on which accessToken was created for the customer.<br><br><b>Endpoints</b>:<ul><li>POST /auth/token</li></ul>"
        readOnly: true
        type: "string"
        format: date-time
      accessToken:
        description: "Access Token to access YSL 1.1 services.<br><br><b>Endpoints</b>:<ul><li>POST /auth/token</li></ul>"
        readOnly: true
        type: "string"

I can see that format is being used for other types, in this example, the int32 format for the integer type.

References:

Proper detailing of POST /auth/token endpoint

The definition found for this endpoint is missing all parameter data, it could be enhanced to include a parameters definition as shown below:

 /auth/token:
    post:
      summary: "Generate Access Token"
      deprecated: false
      produces:
      - "*/*"
      description: "<b>Generate Access Token using client credential authentication.</b><br/><br><br>This service returns access tokens required to access Yodlee 1.1 APIs. These tokens are the <br/>simplest and easiest of several alternatives for authenticating with Yodlee servers.<br/><br><br>The most commonly used services obtain data specific to an end user (your customer). <br/>For these services, you need a <b>user access token</b>. These are simply tokens created with <br/>the user name parameter (<b>loginName</b>) set to the id of your end user.  Note: you determine <br/>this id and you must ensure it's unique among all your customers.<br/><br><br>Each token issued has an associated user. The token passed in the http headers explicitly <br/>names the user referenced in that API call.<br/><br><br>Some of the APIs do administrative work, and don't reference an end user. <br/>One example of administrative work is key management. Another example is <br/>registering a new user explicitly, with <b>POST /user/register</b> call <br/>or subscribe to webhook, with <b>POST /config/notifications/events/{eventName}</b>. <br/>To invoke these, you need an <b>admin access token</b>. Create this by passing in <br/>your admin user login name in place of a regular user name.<br/><br><br>This service also allows for simplified registration of new users. Any time you pass in a user <br/>name not already in use, the system will automatically implicitly create a new user for you. <br/>This user will have naturally have very few associated details. You can later provide additional <br/>user information by calling the <b>PUT user/register service</b>.<br/><br><br><b>Notes:</b><br/>The content type has to be passed as application/x-www-form-urlencoded.<br/>//Upgrading to client credential authentication requires infrastructure reconfiguration. <br/>Customers wishing to switch from another authentication scheme to client credential authentication, <br/>please contact Yodlee Client Services."
      operationId: "generateAccessToken"
      responses:
        201:
          schema:
            $ref: "#/definitions/ClientCredentialTokenResponse"
          description: "OK"
        400:
          schema:
            $ref: "#/definitions/YodleeError"
          description: "Y800 : Invalid value for loginName<br>Y806 : Invalid input<br>Y801 : Invalid length for loginName<br>Y303 : clientId or secret is missing<br>Y301 : Invalid clientId or secret<br>Y305 : Access token can be issued only for pre-registered users<br>Y004 : Inactive user<br>Y901 : Service not supported<br>"
        401:
          schema:
            $ref: "#/definitions/YodleeError"
          description: "Y016 : loginName header missing<br>Y015 : Unauthorized User<br>Y016 : Api-Version header missing<br>Y020 : Invalid token in authorization header<br>Y027 : Unsupported authentication type"
        404:
          description: "Not Found"
      tags:
      - "Auth"
      consumes:
      - "application/x-www-form-urlencoded"
      parameters:
      - in: formData
        name: clientId
        required: true
        type: string
        description: The Client ID.
      - in: formData
        name: secret
        required: true
        type: string
        description: The Client Secret.
      - in: header
        name: loginName
        required: true
        type: string
        description: The id of your end user.

References:

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.