Help shape Plaid’s next-generation SDKs
We’re modernizing Plaid’s SDKs. The new Go library is available now as plaid-go v49, with the previous library included at
github.com/plaid/plaid-go/v49/legacy. For the other languages, register your interest and we’ll follow up when an early release is available. No migration is required today.
Plaid uses the OpenAPI 3.0.0 specification to schematize our docs and to generate our supported client libraries. This provides for a consistent typing experience across our external interfaces. Below we have listed some examples and issues we have found when iterating on the specification.
You can find examples on the official OpenApiGenerator docs.
The following are approximate commands that we use to generate our 5 client libraries:
OpenAPI Generator version: 5.1.1
openapi-generator-cli generate -g typescript-axios \
-i 2020-09-14.yml \
-o build/generated-node \
-p npmName=plaid,supportsES6=true,modelPropertyNaming=original \
-t local/templates/typescript-axiosOpenAPI Generator version: 6.1
openapi-generator-cli generate -g python \
-i 2020-09-14.yml \
-o build/generated-python \
-p packageName=plaid \
--global-property apiTests=false,modelTests=false \
-t templates/pythonOpenAPI Generator version: 6.3
openapi-generator-cli generate -g ruby \
-i 2020-09-14.yml \
-o build/generated-ruby \
--global-property=apiTests=false,modelTests=false,useAutoload=true \
--library=faraday \
-p gemName=plaid,gemRequiredRubyVersion=">= 3.2.0" \
-t local/templates/ruby
OpenAPI Generator version: 5.1.1
openapi-generator-cli generate -g java \
-i 2020-09-14.yml \
-o build/generated-java \
--library=retrofit2 \
--global-property apiDocs=false,modelDocs=false,apiTests=false,modelTests=false \
-p artifactId=plaid,apiPackage=com.plaid.client.request,modelPackage=com.plaid.client.model,dateLibrary=java8 \
-t templates/java \
--type-mappings=BigDecimal=DoubleThe command below generates the previous Go library, which plaid-go v49 includes as the legacy package.
OpenAPI Generator version: 5.2
openapi-generator-cli generate -g go \
-i 2020-09-14.yml \
-o build/plaid-go \
--global-property=apiTests=false,modelTests=false,apiDocs=false,modelDocs=false \
-t templates/go \
-p packageName=plaid,enumClassPrefix=trueThe openapi-generator often uses different styles based on the language you are generating.
-
We found that we had to modify our mustache templates to get
serversandsecuritySchemesworking for some generators. If possible, try not to modify these templates as they cause breaking changes upon upgrading, but modifications might be necessary for cases like these. -
Enums as used by Plaid are extensible; that is, the API may add new enum values at will. However, OpenAPI generator for some languages will enable enum validation by default. You must disable strict enum validation for responses in your generated libraries, or your users may experience crashes when encountering a newly-added enum value in a response.