Replace the mapping
curl --request PUT \
--url https://reporter.sandbox.lerian.net/v1/regulatory/subscriptions/{subscriptionId}/binding \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/yaml' \
--data '<string>'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://reporter.sandbox.lerian.net/v1/regulatory/subscriptions/{subscriptionId}/binding"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/yaml")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/yaml'},
body: '<string>'
};
fetch('https://reporter.sandbox.lerian.net/v1/regulatory/subscriptions/{subscriptionId}/binding', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://reporter.sandbox.lerian.net/v1/regulatory/subscriptions/{subscriptionId}/binding"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/yaml"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text){
"readiness": {
"contractVersion": "<string>",
"document": "<string>",
"queries": [
{
"columnsChecked": true,
"query": "<string>",
"status": "<string>",
"columns": [
{
"column": "<string>",
"found": true,
"unchecked": true
}
],
"composedOver": "<string>",
"dataSource": "<string>",
"detail": "<string>",
"joins": [
{
"columnsChecked": true,
"status": "<string>",
"table": "<string>",
"columns": [
{
"column": "<string>",
"found": true,
"unchecked": true
}
],
"detail": "<string>",
"resolvedTable": "<string>"
}
],
"mismatches": [
"<string>"
],
"resolvedTable": "<string>",
"table": "<string>",
"unexecuted": [
"<string>"
],
"warnings": [
"<string>"
]
}
],
"gaps": [
{
"field": "saldos_cosif.valor",
"reason": "a consulta mapeada não devolve esta coluna",
"required": true,
"list": true
}
],
"mappingOrigin": "<string>",
"startedFrom": "<string>",
"unsupported": [
"<string>"
]
},
"version": 4
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Replace the mapping
Replaces the binding with the document in the request body, IF If-Match carries the version the caller read. Without If-Match the request is refused with 428: saving a mapping without saying what you were editing is how one person’s afternoon disappears. A stale version is refused with 409 naming both versions. The body is capped at 262144 bytes and a larger one is refused with 413 before it is parsed. The answer carries the new version and what the mapping just written can and cannot read.
PUT
/
v1
/
regulatory
/
subscriptions
/
{subscriptionId}
/
binding
Replace the mapping
curl --request PUT \
--url https://reporter.sandbox.lerian.net/v1/regulatory/subscriptions/{subscriptionId}/binding \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/yaml' \
--data '<string>'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://reporter.sandbox.lerian.net/v1/regulatory/subscriptions/{subscriptionId}/binding"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/yaml")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/yaml'},
body: '<string>'
};
fetch('https://reporter.sandbox.lerian.net/v1/regulatory/subscriptions/{subscriptionId}/binding', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://reporter.sandbox.lerian.net/v1/regulatory/subscriptions/{subscriptionId}/binding"
payload = "<string>"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/yaml"
}
response = requests.put(url, data=payload, headers=headers)
print(response.text){
"readiness": {
"contractVersion": "<string>",
"document": "<string>",
"queries": [
{
"columnsChecked": true,
"query": "<string>",
"status": "<string>",
"columns": [
{
"column": "<string>",
"found": true,
"unchecked": true
}
],
"composedOver": "<string>",
"dataSource": "<string>",
"detail": "<string>",
"joins": [
{
"columnsChecked": true,
"status": "<string>",
"table": "<string>",
"columns": [
{
"column": "<string>",
"found": true,
"unchecked": true
}
],
"detail": "<string>",
"resolvedTable": "<string>"
}
],
"mismatches": [
"<string>"
],
"resolvedTable": "<string>",
"table": "<string>",
"unexecuted": [
"<string>"
],
"warnings": [
"<string>"
]
}
],
"gaps": [
{
"field": "saldos_cosif.valor",
"reason": "a consulta mapeada não devolve esta coluna",
"required": true,
"list": true
}
],
"mappingOrigin": "<string>",
"startedFrom": "<string>",
"unsupported": [
"<string>"
]
},
"version": 4
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Corpo
application/yaml
The binding document, replacing the mapping in force.
The binding document, in the same grammar the catalog publishes it in.
Esta página foi útil?

