plaid / plaid-openapi

API version 2020-09-14
https://plaid.com/docs
91 stars 39 forks source link

schemas with type:string has properties? #174

Closed vamayufei closed 2 months ago

vamayufei commented 2 months ago

Hello there! Thanks for maintaining your docs. May I know why do some component schemas of type: string contain properties?

Here's an example:

    StandaloneInvestmentTransactionSellType:
      title: SellType
      description: Selling an investment
      type: string
      properties:
        distribution:
          type: string
          description: Outflow of assets from a tax-advantaged account
        exercise:
          type: string
          description: Exercise of an option or warrant contract
        sell:
          type: string
          description: Sell to close or decrease an existing holding
        sell short:
          type: string
          description: Sell to open a short position

Is this valid openAPI v3? I can't seem to generate a client with another codegen tool.

phoenixy1 commented 2 months ago

Yeah, it's a little confusing and possibly not valid OpenAPI v3. The objects that start with StandAlone are not directly part of the API, they are just convenient representations to provide data that describe certain structures in the API. In this particular case, that object is used to populate the table here: https://plaid.com/docs/api/accounts/#investment-transaction-types-schema.

vamayufei commented 2 months ago

Is the team at plaid not intending to adhere to openAPI v3?

phoenixy1 commented 2 months ago

We validate our spec using the OpenAPI validator toolset and Spectral. The published spec validates correctly against https://apitools.dev/swagger-parser/online/ and https://editor.swagger.io/. We don't have plans to add additional validation beyond that.