Saltar al contenido principal
POST
/
v1
/
management
/
connections
/
validate-schema
Validate schema
curl --request POST \
  --url https://reporter.sandbox.lerian.net/v1/management/connections/validate-schema \
  --header 'Content-Type: application/json' \
  --data '
{
  "mappedFields": {
    "midaz_onboarding": {
      "organization": [
        "id",
        "legal_name",
        "status",
        "created_at"
      ],
      "ledger": [
        "id",
        "organization_id",
        "name"
      ]
    },
    "midaz_transaction": {
      "transaction": [
        "id",
        "ledger_id",
        "amount",
        "status"
      ],
      "account": [
        "id",
        "name",
        "balance"
      ]
    }
  }
}
'
{
  "status": "success",
  "message": "Schema validated successfully. All datasources, tables, and fields exist."
}

Encabezados

Authorization
string

The authorization token in the Bearer <token> format.

Important: This header is required if your environment has Access Manager enabled. For more information, refer to the Access Manager documentation.

Ejemplo:

"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Cuerpo

application/json

Request body for validating schema mappings against configured data sources. Use configName (not the connection UUID) as the key in mappedFields.

mappedFields
object
requerido

Object containing the field mapping configuration. The structure is: { configName: { tableName: [field1, field2, ...] } }. Use the connection's configName as the top-level key.

Ejemplo:
{
"midaz_onboarding": {
"organization": ["id", "legal_name", "status"],
"ledger": ["id", "organization_id", "name"]
}
}

Respuesta

La validación del esquema se realizó correctamente. Todos los orígenes de datos, tablas y campos referenciados existen. Cuando la validación encuentra inconsistencias, el endpoint devuelve una respuesta 422 en lugar de este cuerpo.

Objeto de respuesta devuelto cuando la validación del esquema se realiza correctamente. Cuando la validación falla, el endpoint devuelve una respuesta 422 utilizando el esquema SchemaValidationErrorResponse en su lugar.

status
enum<string>
requerido

El estado del resultado de la validación. Siempre es success para este cuerpo de respuesta.

Opciones disponibles:
success
Ejemplo:

"success"

message
string
requerido

A human-readable summary of the validation result.

Ejemplo:

"Schema validated successfully. All datasources, tables, and fields exist."