Skip to main content
POST
/
v0
/
contract
/
validate
Validate a contract
curl --request POST \
  --url https://{hostname}.gable.ai/v0/contract/validate \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "ACTIVE",
  "contractSpec": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "doc": "<string>",
    "name": "<string>",
    "namespace": "<string>",
    "owner": "[email protected]",
    "schema": [
      {
        "type": "struct",
        "name": "<string>",
        "fields": [
          {
            "type": "struct",
            "name": "<string>",
            "fields": "<array>",
            "alias": "<string>",
            "doc": "<string>",
            "logical": "<string>",
            "optional": true
          }
        ],
        "alias": "<string>",
        "doc": "<string>",
        "logical": "<string>",
        "optional": true,
        "constraints": {}
      }
    ],
    "dataAssetResourceName": "<string>",
    "dataAssetResourceNameList": [
      "<string>"
    ],
    "restrictPii": true
  },
  "parentRowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "version": "<string>",
  "gitHash": "<string>",
  "gitRepo": "<string>",
  "gitUser": "<string>",
  "reviewers": [
    "<string>"
  ],
  "filePath": "<string>",
  "mergedAt": "2023-11-07T05:31:56Z",
  "enforcementLevel": "RECORD",
  "lastEditorUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "lastEditorEmail": "<string>",
  "lastEditorFirstName": "<string>",
  "lastEditorLastName": "<string>",
  "lastEditorGithubHandle": "<string>"
}
'
{
  "message": "<string>",
  "success": true
}

Authorizations

X-API-KEY
string
header
required

Body

application/json

Contract

The metadata and schema for the Contract that is sent to Gable to be validated and uploaded. It may or may not contain a valid contract.

id
string<uuid>
required

Unique identifier for the contract in UUID format

status
enum<string>
required

status of the contract

Available options:
ACTIVE,
DEPRECATED,
DRAFT,
ARCHIVED
contractSpec
object
required

This is the possible contract specification. If it is valid, it will match the contract specification schema. However, we have to allow for invalid contracts to be passed to Gable even if we reject them.

parentRowId
string<uuid>

Unique identifier for a contract's parent row id in UUID format

version
string

Version of the contract (semantic versioning)

gitHash
string

full length git hash corresponding to the commit this contract was added/updated

Required string length: 40
gitRepo
string<uri>

full link to the git repo this contract lives in

gitUser
string

git user who added this contract

reviewers
string[]

optional list of users who reviewed the merged PR that this contract added/updated in

filePath
string

path to the contract file from the root of the git repository

mergedAt
string<date-time>

date time at which the PR that added/updated this contract was merged

enforcementLevel
enum<string> | null

alert level for contract

Available options:
RECORD,
NOTIFY,
ALERT,
BLOCK,
INACTIVE
lastEditorUserId
string<uuid> | null

Unique identifier for the user who last edited the contract through the UI

lastEditorEmail
string | null

Email of the user who last edited the contract through the UI

lastEditorFirstName
string | null

First name of the user who last edited the contract through the UI

lastEditorLastName
string | null

Last name of the user who last edited the contract through the UI

lastEditorGithubHandle
string | null

GitHub handle of the user who last edited the contract through the UI

Response

200 - application/json

Response when validation could be completed

message
string
required
success
boolean
required