Validate a contract
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",
"contractSpec": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"doc": "<string>",
"name": "<string>",
"namespace": "<string>",
"owner": "jsmith@example.com",
"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",
"lastEditorUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lastEditorEmail": "<string>",
"lastEditorFirstName": "<string>",
"lastEditorLastName": "<string>",
"lastEditorGithubHandle": "<string>"
}
'import requests
url = "https://{hostname}.gable.ai/v0/contract/validate"
payload = {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contractSpec": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"doc": "<string>",
"name": "<string>",
"namespace": "<string>",
"owner": "jsmith@example.com",
"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",
"lastEditorUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lastEditorEmail": "<string>",
"lastEditorFirstName": "<string>",
"lastEditorLastName": "<string>",
"lastEditorGithubHandle": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
contractSpec: {
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
doc: '<string>',
name: '<string>',
namespace: '<string>',
owner: 'jsmith@example.com',
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',
lastEditorUserId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
lastEditorEmail: '<string>',
lastEditorFirstName: '<string>',
lastEditorLastName: '<string>',
lastEditorGithubHandle: '<string>'
})
};
fetch('https://{hostname}.gable.ai/v0/contract/validate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{hostname}.gable.ai/v0/contract/validate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'contractSpec' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'doc' => '<string>',
'name' => '<string>',
'namespace' => '<string>',
'owner' => 'jsmith@example.com',
'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',
'lastEditorUserId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'lastEditorEmail' => '<string>',
'lastEditorFirstName' => '<string>',
'lastEditorLastName' => '<string>',
'lastEditorGithubHandle' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{hostname}.gable.ai/v0/contract/validate"
payload := strings.NewReader("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contractSpec\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"doc\": \"<string>\",\n \"name\": \"<string>\",\n \"namespace\": \"<string>\",\n \"owner\": \"jsmith@example.com\",\n \"schema\": [\n {\n \"type\": \"struct\",\n \"name\": \"<string>\",\n \"fields\": [\n {\n \"type\": \"struct\",\n \"name\": \"<string>\",\n \"fields\": \"<array>\",\n \"alias\": \"<string>\",\n \"doc\": \"<string>\",\n \"logical\": \"<string>\",\n \"optional\": true\n }\n ],\n \"alias\": \"<string>\",\n \"doc\": \"<string>\",\n \"logical\": \"<string>\",\n \"optional\": true,\n \"constraints\": {}\n }\n ],\n \"dataAssetResourceName\": \"<string>\",\n \"dataAssetResourceNameList\": [\n \"<string>\"\n ],\n \"restrictPii\": true\n },\n \"parentRowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"version\": \"<string>\",\n \"gitHash\": \"<string>\",\n \"gitRepo\": \"<string>\",\n \"gitUser\": \"<string>\",\n \"reviewers\": [\n \"<string>\"\n ],\n \"filePath\": \"<string>\",\n \"mergedAt\": \"2023-11-07T05:31:56Z\",\n \"lastEditorUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"lastEditorEmail\": \"<string>\",\n \"lastEditorFirstName\": \"<string>\",\n \"lastEditorLastName\": \"<string>\",\n \"lastEditorGithubHandle\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{hostname}.gable.ai/v0/contract/validate")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contractSpec\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"doc\": \"<string>\",\n \"name\": \"<string>\",\n \"namespace\": \"<string>\",\n \"owner\": \"jsmith@example.com\",\n \"schema\": [\n {\n \"type\": \"struct\",\n \"name\": \"<string>\",\n \"fields\": [\n {\n \"type\": \"struct\",\n \"name\": \"<string>\",\n \"fields\": \"<array>\",\n \"alias\": \"<string>\",\n \"doc\": \"<string>\",\n \"logical\": \"<string>\",\n \"optional\": true\n }\n ],\n \"alias\": \"<string>\",\n \"doc\": \"<string>\",\n \"logical\": \"<string>\",\n \"optional\": true,\n \"constraints\": {}\n }\n ],\n \"dataAssetResourceName\": \"<string>\",\n \"dataAssetResourceNameList\": [\n \"<string>\"\n ],\n \"restrictPii\": true\n },\n \"parentRowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"version\": \"<string>\",\n \"gitHash\": \"<string>\",\n \"gitRepo\": \"<string>\",\n \"gitUser\": \"<string>\",\n \"reviewers\": [\n \"<string>\"\n ],\n \"filePath\": \"<string>\",\n \"mergedAt\": \"2023-11-07T05:31:56Z\",\n \"lastEditorUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"lastEditorEmail\": \"<string>\",\n \"lastEditorFirstName\": \"<string>\",\n \"lastEditorLastName\": \"<string>\",\n \"lastEditorGithubHandle\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{hostname}.gable.ai/v0/contract/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contractSpec\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"doc\": \"<string>\",\n \"name\": \"<string>\",\n \"namespace\": \"<string>\",\n \"owner\": \"jsmith@example.com\",\n \"schema\": [\n {\n \"type\": \"struct\",\n \"name\": \"<string>\",\n \"fields\": [\n {\n \"type\": \"struct\",\n \"name\": \"<string>\",\n \"fields\": \"<array>\",\n \"alias\": \"<string>\",\n \"doc\": \"<string>\",\n \"logical\": \"<string>\",\n \"optional\": true\n }\n ],\n \"alias\": \"<string>\",\n \"doc\": \"<string>\",\n \"logical\": \"<string>\",\n \"optional\": true,\n \"constraints\": {}\n }\n ],\n \"dataAssetResourceName\": \"<string>\",\n \"dataAssetResourceNameList\": [\n \"<string>\"\n ],\n \"restrictPii\": true\n },\n \"parentRowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"version\": \"<string>\",\n \"gitHash\": \"<string>\",\n \"gitRepo\": \"<string>\",\n \"gitUser\": \"<string>\",\n \"reviewers\": [\n \"<string>\"\n ],\n \"filePath\": \"<string>\",\n \"mergedAt\": \"2023-11-07T05:31:56Z\",\n \"lastEditorUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"lastEditorEmail\": \"<string>\",\n \"lastEditorFirstName\": \"<string>\",\n \"lastEditorLastName\": \"<string>\",\n \"lastEditorGithubHandle\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true
}Authorizations
Body
Contract
- object
- object[]
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.
Unique identifier for the contract in UUID format
status of the contract
ACTIVE, DEPRECATED, DRAFT, ARCHIVED 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.
Show child attributes
Show child attributes
Unique identifier for a contract's parent row id in UUID format
Version of the contract (semantic versioning)
full length git hash corresponding to the commit this contract was added/updated
40full link to the git repo this contract lives in
git user who added this contract
optional list of users who reviewed the merged PR that this contract added/updated in
path to the contract file from the root of the git repository
^([^/]+\/)*[^/]+$date time at which the PR that added/updated this contract was merged
alert level for contract
RECORD, NOTIFY, ALERT, BLOCK, INACTIVE Unique identifier for the user who last edited the contract through the UI
Email of the user who last edited the contract through the UI
First name of the user who last edited the contract through the UI
Last name of the user who last edited the contract through the UI
GitHub handle of the user who last edited the contract through the UI
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",
"contractSpec": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"doc": "<string>",
"name": "<string>",
"namespace": "<string>",
"owner": "jsmith@example.com",
"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",
"lastEditorUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lastEditorEmail": "<string>",
"lastEditorFirstName": "<string>",
"lastEditorLastName": "<string>",
"lastEditorGithubHandle": "<string>"
}
'import requests
url = "https://{hostname}.gable.ai/v0/contract/validate"
payload = {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contractSpec": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"doc": "<string>",
"name": "<string>",
"namespace": "<string>",
"owner": "jsmith@example.com",
"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",
"lastEditorUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lastEditorEmail": "<string>",
"lastEditorFirstName": "<string>",
"lastEditorLastName": "<string>",
"lastEditorGithubHandle": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
contractSpec: {
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
doc: '<string>',
name: '<string>',
namespace: '<string>',
owner: 'jsmith@example.com',
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',
lastEditorUserId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
lastEditorEmail: '<string>',
lastEditorFirstName: '<string>',
lastEditorLastName: '<string>',
lastEditorGithubHandle: '<string>'
})
};
fetch('https://{hostname}.gable.ai/v0/contract/validate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{hostname}.gable.ai/v0/contract/validate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'contractSpec' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'doc' => '<string>',
'name' => '<string>',
'namespace' => '<string>',
'owner' => 'jsmith@example.com',
'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',
'lastEditorUserId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'lastEditorEmail' => '<string>',
'lastEditorFirstName' => '<string>',
'lastEditorLastName' => '<string>',
'lastEditorGithubHandle' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{hostname}.gable.ai/v0/contract/validate"
payload := strings.NewReader("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contractSpec\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"doc\": \"<string>\",\n \"name\": \"<string>\",\n \"namespace\": \"<string>\",\n \"owner\": \"jsmith@example.com\",\n \"schema\": [\n {\n \"type\": \"struct\",\n \"name\": \"<string>\",\n \"fields\": [\n {\n \"type\": \"struct\",\n \"name\": \"<string>\",\n \"fields\": \"<array>\",\n \"alias\": \"<string>\",\n \"doc\": \"<string>\",\n \"logical\": \"<string>\",\n \"optional\": true\n }\n ],\n \"alias\": \"<string>\",\n \"doc\": \"<string>\",\n \"logical\": \"<string>\",\n \"optional\": true,\n \"constraints\": {}\n }\n ],\n \"dataAssetResourceName\": \"<string>\",\n \"dataAssetResourceNameList\": [\n \"<string>\"\n ],\n \"restrictPii\": true\n },\n \"parentRowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"version\": \"<string>\",\n \"gitHash\": \"<string>\",\n \"gitRepo\": \"<string>\",\n \"gitUser\": \"<string>\",\n \"reviewers\": [\n \"<string>\"\n ],\n \"filePath\": \"<string>\",\n \"mergedAt\": \"2023-11-07T05:31:56Z\",\n \"lastEditorUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"lastEditorEmail\": \"<string>\",\n \"lastEditorFirstName\": \"<string>\",\n \"lastEditorLastName\": \"<string>\",\n \"lastEditorGithubHandle\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{hostname}.gable.ai/v0/contract/validate")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contractSpec\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"doc\": \"<string>\",\n \"name\": \"<string>\",\n \"namespace\": \"<string>\",\n \"owner\": \"jsmith@example.com\",\n \"schema\": [\n {\n \"type\": \"struct\",\n \"name\": \"<string>\",\n \"fields\": [\n {\n \"type\": \"struct\",\n \"name\": \"<string>\",\n \"fields\": \"<array>\",\n \"alias\": \"<string>\",\n \"doc\": \"<string>\",\n \"logical\": \"<string>\",\n \"optional\": true\n }\n ],\n \"alias\": \"<string>\",\n \"doc\": \"<string>\",\n \"logical\": \"<string>\",\n \"optional\": true,\n \"constraints\": {}\n }\n ],\n \"dataAssetResourceName\": \"<string>\",\n \"dataAssetResourceNameList\": [\n \"<string>\"\n ],\n \"restrictPii\": true\n },\n \"parentRowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"version\": \"<string>\",\n \"gitHash\": \"<string>\",\n \"gitRepo\": \"<string>\",\n \"gitUser\": \"<string>\",\n \"reviewers\": [\n \"<string>\"\n ],\n \"filePath\": \"<string>\",\n \"mergedAt\": \"2023-11-07T05:31:56Z\",\n \"lastEditorUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"lastEditorEmail\": \"<string>\",\n \"lastEditorFirstName\": \"<string>\",\n \"lastEditorLastName\": \"<string>\",\n \"lastEditorGithubHandle\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{hostname}.gable.ai/v0/contract/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contractSpec\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"doc\": \"<string>\",\n \"name\": \"<string>\",\n \"namespace\": \"<string>\",\n \"owner\": \"jsmith@example.com\",\n \"schema\": [\n {\n \"type\": \"struct\",\n \"name\": \"<string>\",\n \"fields\": [\n {\n \"type\": \"struct\",\n \"name\": \"<string>\",\n \"fields\": \"<array>\",\n \"alias\": \"<string>\",\n \"doc\": \"<string>\",\n \"logical\": \"<string>\",\n \"optional\": true\n }\n ],\n \"alias\": \"<string>\",\n \"doc\": \"<string>\",\n \"logical\": \"<string>\",\n \"optional\": true,\n \"constraints\": {}\n }\n ],\n \"dataAssetResourceName\": \"<string>\",\n \"dataAssetResourceNameList\": [\n \"<string>\"\n ],\n \"restrictPii\": true\n },\n \"parentRowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"version\": \"<string>\",\n \"gitHash\": \"<string>\",\n \"gitRepo\": \"<string>\",\n \"gitUser\": \"<string>\",\n \"reviewers\": [\n \"<string>\"\n ],\n \"filePath\": \"<string>\",\n \"mergedAt\": \"2023-11-07T05:31:56Z\",\n \"lastEditorUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"lastEditorEmail\": \"<string>\",\n \"lastEditorFirstName\": \"<string>\",\n \"lastEditorLastName\": \"<string>\",\n \"lastEditorGithubHandle\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true
}