past, present and future
Undocumented APIs
Lack of design consistancy
No design review
Ajax End Points
Ajax End Points
Ajax End Points
Single source of truth
#%RAML 1.0
title: Personal Loan Surefire JSON Endpoints
version: draft
baseUri: https://surefire.creditkarma.com/
#Libraries
uses:
Payload: !include types/payloadTypes.raml
DataTypes: !include types/dataTypes.raml
NumericId: !include types/numericId.raml
CK: !include lib/ck-php-core-spec/commonTypes.raml
resourceTypes:
offers: !include types/offersResourceType.raml
# TODO: compress these down into fewer resources where common structure is ensured
/personal-loans/{version}:
/users/{numericId}:
uriParameters:
numericId: CK.numericId
/offers:
type: offers
description: |
A user can have multiple offers that all are type PersonalLoans.
If you ask for a user's offers, you will get a user's offers. If you want ITA or some other, apply the filters.
Credit Karma Raml Tools
Confluence: Search RAML Tools
> npm install --save-dev @ck/kraml-lint
> echo '{"extends": "@ck/kraml-lint/config/CKConfig.js"}' >> .kraml-lintrc
> node_modules/.bin/kraml-lint path/to/your.raml
{
"scripts": {
"test": "kraml-lint path/to/your.raml"
}
}
add test to package.json
The Kraml Linter checks that RAML projects for consistency and standards.
Uses RAML as a source of truth for generating Server and Client code
Server side contract generation to insure servers generate valid results
Client side generation to make consuming APIs easier
According to your RAML file, I can hit X endpoint with Y parameters and expect Z response structure – right?
The contract test tool takes your RAML to task and actually tests this.
{
"account": {
"status": 1,
"type": 2,
"remarks": "",
"times": [{
"days": 30,
"late": 0
}, {
"days": 60,
"late": 0
}]
}
}
Account status | Open |
Type | Flexible Spending Credit Card |
Responsibility | Individual |
Remarks | |
Times 30/60/90 days late | 0/0/0 |
{
"details": [
["Account status", "Open"],
["Type", "Flexible Spending Credit Card"],
["Responsibility", "Individual"],
["Remarks",""],
["Times 30/60/90 days","0/0/0"]
]
}
GraphQL
Standardizing on API.CREDITKARMA.COM