/finicity-openapi

The OpenAPI specification for Finicity APIs (๐Ÿ‡บ๐Ÿ‡ธ), along with a suite of tests using a generated API client and the Finicity Test Drive.

Primary LanguageJavaApache License 2.0Apache-2.0

finicity-openapi

Overview

The OpenAPI specification for Finicity APIs (๐Ÿ‡บ๐Ÿ‡ธ), along with a suite of tests using a generated API client and the Finicity Test Drive.

Workflows

The following workflows ensure the API specification stays in good shape and can be used to consume the Finicity APIs from your application:

Specification

YAML โค“ | Swagger Editor โฌˆ | Redoc โฌˆ

Tests

Things to Know ๐Ÿ‘‡

  • The test project generates an API client library from the API specification like you would do in a real application (OpenAPI Generator is used for that)
  • A free Finicity account is required to obtain your Partner ID, Partner Secret and Finicity App Key:

  • Before running the tests, you need a Customer ID. For that, run setup.sh and use the output of the script in the next sections. This script will call:
    • addTestingCustomer
    • generateConnectUrl (Finicity Connect). Simply open the URL and add to your test customer all accounts from profile_09.
    • refreshCustomerAccounts

Run Tests Locally

  1. Clone this repository
  2. Run cd tests && mvn clean test -DpartnerId=*** -DpartnerSecret=*** -DappKey=*** -DcustomerId=***
  3. Expected result:
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
โ€ฆ
[INFO] Results:
[INFO]
[INFO] Tests run: 111, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:08 min
[INFO] Finished at: 2022-04-20T14:47:43+01:00
[INFO] ------------------------------------------------------------------------

Run Tests in GitHub

  1. Fork this repository
  2. Go to Settings > Secrets > Actions
  3. Create new repository secrets: PARTNER_ID, PARTNER_SECRET, APP_KEY and CUSTOMER_ID
  4. Enable workflows in the Actions tab
  5. Click Run workflow under API Client Tests. Expected result: โœ”๏ธ

What's Next?

The Finicity API specification and a generated API client are the only things you need to call Finicity from your application.

Guidelines

When updating the Finicity API specification:

  1. Ensure it can be rendered without errors in Swagger Editor or Redoc
  2. Ensure an API client can be generated using OpenAPI Generator
  3. Prettify the YAML using npx prettier --write --single-quote --prose-wrap always finicity.yaml
  4. Update and/or add tests to the test project
    • Generate new tests by using true for generateApiTests in the POM file
    • Move the generated classes from /target/generated-sources/openapi/src/test/ to /src
    • Update the generated test methods