---
title: "Test a Connection Schema"
---

> Documentation Index
> Fetch the complete documentation index at: https://www.arroyo.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Test a Connection Schema

Path: Arroyo REST API › connection_tables

`POST /v1/connection_tables/schemas/test`

URL: `http://localhost:5115/api/v1/connection_tables/schemas/test`

## Request body

_Required._

- `bad_data` (`test_schema.bad_data`; one of, optional, nullable)
  - one of the following:
    - `Fail`
      - `behavior` (`test_schema.bad_data.1.behavior`; string, required)
        - one of `"fail"`
    - `Drop`
      - `behavior` (`test_schema.bad_data.2.behavior`; string, required)
        - one of `"drop"`
  - discriminator: `behavior`
- `definition` (`test_schema.definition`; one of, optional, nullable)
  - every option has:
    - `schema` (`<option>.schema`; string, required)
  - one of the following, each adding:
    - `JsonSchema` (`test_schema.definition.1`)
      - `type` (`test_schema.definition.1.type`; string, required)
        - one of `"json_schema"`
    - `Protobuf` (`test_schema.definition.2`)
      - `type` (`test_schema.definition.2.type`; string, required)
        - one of `"protobuf_schema"`
      - `dependencies` (`test_schema.definition.2.dependencies`; map of string, optional)
    - `Avro` (`test_schema.definition.3`)
      - `type` (`test_schema.definition.3.type`; string, required)
        - one of `"avro_schema"`
  - discriminator: `type`
- `fields` (`test_schema.fields`; array of SourceField, optional)
  - `name` (`test_schema.fields.name`; string, required)
  - `metadata_key` (`test_schema.fields.metadata_key`; string, optional, nullable)
  - `required` (`test_schema.fields.required`; boolean, optional)
  - and one of the following:
    - `Int32`
      - `type` (`test_schema.fields.1.type`; string, required)
        - one of `"int32"`
    - `Int64`
      - `type` (`test_schema.fields.2.type`; string, required)
        - one of `"int64"`
    - `UInt32`
      - `type` (`test_schema.fields.3.type`; string, required)
        - one of `"uint32"`
    - `UInt64`
      - `type` (`test_schema.fields.4.type`; string, required)
        - one of `"uint64"`
    - `Float32`
      - `type` (`test_schema.fields.5.type`; string, required)
        - one of `"float32"`
    - `Float64`
      - `type` (`test_schema.fields.6.type`; string, required)
        - one of `"float64"`
    - `Decimal128`
      - `precision` (`test_schema.fields.7.precision`; integer, required)
        - format: `int32` · minimum: `0`
      - `scale` (`test_schema.fields.7.scale`; integer, required)
        - format: `int32`
      - `type` (`test_schema.fields.7.type`; string, required)
        - one of `"decimal128"`
    - `Bool`
      - `type` (`test_schema.fields.8.type`; string, required)
        - one of `"bool"`
    - `String`
      - `type` (`test_schema.fields.9.type`; string, required)
        - one of `"string"`
    - `Bytes`
      - `type` (`test_schema.fields.10.type`; string, required)
        - one of `"bytes"`
    - `Timestamp`
      - `type` (`test_schema.fields.11.type`; string, required)
        - one of `"timestamp"`
      - `unit` (`test_schema.fields.11.unit`; string, optional)
        - one of `"second"`, `"millisecond"`, `"microsecond"`, `"nanosecond"`
    - `Json`
      - `type` (`test_schema.fields.12.type`; string, required)
        - one of `"json"`
    - `Struct`
      - `fields` (`test_schema.fields.13.fields`; array of SourceField, required)
        - `name` (`test_schema.fields.13.fields.name`; string, required)
        - `metadata_key` (`test_schema.fields.13.fields.metadata_key`; string, optional, nullable)
        - `required` (`test_schema.fields.13.fields.required`; boolean, optional)
        - and one of the following:
          - `Int32`
            - `type` (`test_schema.fields.13.fields.1.type`; string, required)
              - one of `"int32"`
          - `Int64`
            - `type` (`test_schema.fields.13.fields.2.type`; string, required)
              - one of `"int64"`
          - `UInt32`
            - `type` (`test_schema.fields.13.fields.3.type`; string, required)
              - one of `"uint32"`
          - `UInt64`
            - `type` (`test_schema.fields.13.fields.4.type`; string, required)
              - one of `"uint64"`
          - `Float32`
            - `type` (`test_schema.fields.13.fields.5.type`; string, required)
              - one of `"float32"`
          - `Float64`
            - `type` (`test_schema.fields.13.fields.6.type`; string, required)
              - one of `"float64"`
          - `Decimal128`
            - `precision` (`test_schema.fields.13.fields.7.precision`; integer, required)
              - format: `int32` · minimum: `0`
            - `scale` (`test_schema.fields.13.fields.7.scale`; integer, required)
              - format: `int32`
            - `type` (`test_schema.fields.13.fields.7.type`; string, required)
              - one of `"decimal128"`
          - `Bool`
            - `type` (`test_schema.fields.13.fields.8.type`; string, required)
              - one of `"bool"`
          - `String`
            - `type` (`test_schema.fields.13.fields.9.type`; string, required)
              - one of `"string"`
          - `Bytes`
            - `type` (`test_schema.fields.13.fields.10.type`; string, required)
              - one of `"bytes"`
          - `Timestamp`
            - `type` (`test_schema.fields.13.fields.11.type`; string, required)
              - one of `"timestamp"`
            - `unit` (`test_schema.fields.13.fields.11.unit`; string, optional)
              - one of `"second"`, `"millisecond"`, `"microsecond"`, `"nanosecond"`
          - `Json`
            - `type` (`test_schema.fields.13.fields.12.type`; string, required)
              - one of `"json"`
          - `Struct`
          - `List`
            - `items` (`test_schema.fields.13.fields.14.items`; ListFieldItem, required)
              - `name` (`test_schema.fields.13.fields.14.items.name`; string, optional)
              - `required` (`test_schema.fields.13.fields.14.items.required`; boolean, optional)
              - and one of the following:
                - `Int32`
                  - `type` (`test_schema.fields.13.fields.14.items.1.type`; string, required)
                    - one of `"int32"`
                - `Int64`
                  - `type` (`test_schema.fields.13.fields.14.items.2.type`; string, required)
                    - one of `"int64"`
                - `UInt32`
                  - `type` (`test_schema.fields.13.fields.14.items.3.type`; string, required)
                    - one of `"uint32"`
                - `UInt64`
                  - `type` (`test_schema.fields.13.fields.14.items.4.type`; string, required)
                    - one of `"uint64"`
                - `Float32`
                  - `type` (`test_schema.fields.13.fields.14.items.5.type`; string, required)
                    - one of `"float32"`
                - `Float64`
                  - `type` (`test_schema.fields.13.fields.14.items.6.type`; string, required)
                    - one of `"float64"`
                - `Decimal128`
                  - `precision` (`test_schema.fields.13.fields.14.items.7.precision`; integer, required)
                    - format: `int32` · minimum: `0`
                  - `scale` (`test_schema.fields.13.fields.14.items.7.scale`; integer, required)
                    - format: `int32`
                  - `type` (`test_schema.fields.13.fields.14.items.7.type`; string, required)
                    - one of `"decimal128"`
                - `Bool`
                  - `type` (`test_schema.fields.13.fields.14.items.8.type`; string, required)
                    - one of `"bool"`
                - `String`
                  - `type` (`test_schema.fields.13.fields.14.items.9.type`; string, required)
                    - one of `"string"`
                - `Bytes`
                  - `type` (`test_schema.fields.13.fields.14.items.10.type`; string, required)
                    - one of `"bytes"`
                - `Timestamp`
                  - `type` (`test_schema.fields.13.fields.14.items.11.type`; string, required)
                    - one of `"timestamp"`
                  - `unit` (`test_schema.fields.13.fields.14.items.11.unit`; string, optional)
                    - one of `"second"`, `"millisecond"`, `"microsecond"`, `"nanosecond"`
                - `Json`
                  - `type` (`test_schema.fields.13.fields.14.items.12.type`; string, required)
                    - one of `"json"`
                - `Struct`
                - `List`
              - discriminator: `type`
            - `type` (`test_schema.fields.13.fields.14.type`; string, required)
              - one of `"list"`
        - discriminator: `type`
      - `type` (`test_schema.fields.13.type`; string, required)
        - one of `"struct"`
    - `List`
      - `items` (`test_schema.fields.14.items`; ListFieldItem, required)
        - `name` (`test_schema.fields.14.items.name`; string, optional)
        - `required` (`test_schema.fields.14.items.required`; boolean, optional)
        - and one of the following:
          - `Int32`
            - `type` (`test_schema.fields.14.items.1.type`; string, required)
              - one of `"int32"`
          - `Int64`
            - `type` (`test_schema.fields.14.items.2.type`; string, required)
              - one of `"int64"`
          - `UInt32`
            - `type` (`test_schema.fields.14.items.3.type`; string, required)
              - one of `"uint32"`
          - `UInt64`
            - `type` (`test_schema.fields.14.items.4.type`; string, required)
              - one of `"uint64"`
          - `Float32`
            - `type` (`test_schema.fields.14.items.5.type`; string, required)
              - one of `"float32"`
          - `Float64`
            - `type` (`test_schema.fields.14.items.6.type`; string, required)
              - one of `"float64"`
          - `Decimal128`
            - `precision` (`test_schema.fields.14.items.7.precision`; integer, required)
              - format: `int32` · minimum: `0`
            - `scale` (`test_schema.fields.14.items.7.scale`; integer, required)
              - format: `int32`
            - `type` (`test_schema.fields.14.items.7.type`; string, required)
              - one of `"decimal128"`
          - `Bool`
            - `type` (`test_schema.fields.14.items.8.type`; string, required)
              - one of `"bool"`
          - `String`
            - `type` (`test_schema.fields.14.items.9.type`; string, required)
              - one of `"string"`
          - `Bytes`
            - `type` (`test_schema.fields.14.items.10.type`; string, required)
              - one of `"bytes"`
          - `Timestamp`
            - `type` (`test_schema.fields.14.items.11.type`; string, required)
              - one of `"timestamp"`
            - `unit` (`test_schema.fields.14.items.11.unit`; string, optional)
              - one of `"second"`, `"millisecond"`, `"microsecond"`, `"nanosecond"`
          - `Json`
            - `type` (`test_schema.fields.14.items.12.type`; string, required)
              - one of `"json"`
          - `Struct`
            - `fields` (`test_schema.fields.14.items.13.fields`; array of SourceField, required)
              - `name` (`test_schema.fields.14.items.13.fields.name`; string, required)
              - `metadata_key` (`test_schema.fields.14.items.13.fields.metadata_key`; string, optional, nullable)
              - `required` (`test_schema.fields.14.items.13.fields.required`; boolean, optional)
              - and one of the following:
                - `Int32`
                  - `type` (`test_schema.fields.14.items.13.fields.1.type`; string, required)
                    - one of `"int32"`
                - `Int64`
                  - `type` (`test_schema.fields.14.items.13.fields.2.type`; string, required)
                    - one of `"int64"`
                - `UInt32`
                  - `type` (`test_schema.fields.14.items.13.fields.3.type`; string, required)
                    - one of `"uint32"`
                - `UInt64`
                  - `type` (`test_schema.fields.14.items.13.fields.4.type`; string, required)
                    - one of `"uint64"`
                - `Float32`
                  - `type` (`test_schema.fields.14.items.13.fields.5.type`; string, required)
                    - one of `"float32"`
                - `Float64`
                  - `type` (`test_schema.fields.14.items.13.fields.6.type`; string, required)
                    - one of `"float64"`
                - `Decimal128`
                  - `precision` (`test_schema.fields.14.items.13.fields.7.precision`; integer, required)
                    - format: `int32` · minimum: `0`
                  - `scale` (`test_schema.fields.14.items.13.fields.7.scale`; integer, required)
                    - format: `int32`
                  - `type` (`test_schema.fields.14.items.13.fields.7.type`; string, required)
                    - one of `"decimal128"`
                - `Bool`
                  - `type` (`test_schema.fields.14.items.13.fields.8.type`; string, required)
                    - one of `"bool"`
                - `String`
                  - `type` (`test_schema.fields.14.items.13.fields.9.type`; string, required)
                    - one of `"string"`
                - `Bytes`
                  - `type` (`test_schema.fields.14.items.13.fields.10.type`; string, required)
                    - one of `"bytes"`
                - `Timestamp`
                  - `type` (`test_schema.fields.14.items.13.fields.11.type`; string, required)
                    - one of `"timestamp"`
                  - `unit` (`test_schema.fields.14.items.13.fields.11.unit`; string, optional)
                    - one of `"second"`, `"millisecond"`, `"microsecond"`, `"nanosecond"`
                - `Json`
                  - `type` (`test_schema.fields.14.items.13.fields.12.type`; string, required)
                    - one of `"json"`
                - `Struct`
                - `List`
              - discriminator: `type`
            - `type` (`test_schema.fields.14.items.13.type`; string, required)
              - one of `"struct"`
          - `List`
        - discriminator: `type`
      - `type` (`test_schema.fields.14.type`; string, required)
        - one of `"list"`
  - discriminator: `type`
- `format` (`test_schema.format`; one of, optional, nullable)
  - one of the following:
    - `Json`
      - `type` (`test_schema.format.1.type`; string, required)
        - one of `"json"`
      - `compression` (`test_schema.format.1.compression`; string, optional)
        - one of `"uncompressed"`, `"gzip"`
      - `confluent_schema_registry` (`test_schema.format.1.confluent_schema_registry`; boolean, optional)
      - `debezium` (`test_schema.format.1.debezium`; boolean, optional)
      - `decimal_encoding` (`test_schema.format.1.decimal_encoding`; string, optional)
        - one of `"number"`, `"string"`, `"bytes"`
      - `include_schema` (`test_schema.format.1.include_schema`; boolean, optional)
      - `schema_id` (`test_schema.format.1.schema_id`; integer, optional, nullable)
        - format: `int32` · minimum: `0`
      - `timestamp_format` (`test_schema.format.1.timestamp_format`; string, optional)
        - one of `"rfc3339"`, `"unix_millis"`
      - `unstructured` (`test_schema.format.1.unstructured`; boolean, optional)
    - `Avro`
      - `type` (`test_schema.format.2.type`; string, required)
        - one of `"avro"`
      - `confluent_schema_registry` (`test_schema.format.2.confluent_schema_registry`; boolean, optional)
      - `into_unstructured_json` (`test_schema.format.2.into_unstructured_json`; boolean, optional)
      - `raw_datums` (`test_schema.format.2.raw_datums`; boolean, optional)
    - `Protobuf`
      - `type` (`test_schema.format.3.type`; string, required)
        - one of `"protobuf"`
      - `compiled_schema` (`test_schema.format.3.compiled_schema`; string, optional, nullable)
        - format: `binary`
      - `confluent_schema_registry` (`test_schema.format.3.confluent_schema_registry`; boolean, optional)
      - `into_unstructured_json` (`test_schema.format.3.into_unstructured_json`; boolean, optional)
      - `length_delimited` (`test_schema.format.3.length_delimited`; boolean, optional)
      - `message_name` (`test_schema.format.3.message_name`; string, optional, nullable)
    - `Parquet`
      - `type` (`test_schema.format.4.type`; string, required)
        - one of `"parquet"`
      - `compression` (`test_schema.format.4.compression`; string, optional)
        - one of `"uncompressed"`, `"snappy"`, `"gzip"`, `"zstd"`, `"lz4"`, `"lz4_raw"`
      - `row_group_bytes` (`test_schema.format.4.row_group_bytes`; integer, optional, nullable)
        - format: `int64` · minimum: `0`
    - `RawString`
      - `type` (`test_schema.format.5.type`; string, required)
        - one of `"raw_string"`
    - `RawBytes`
      - `type` (`test_schema.format.6.type`; string, required)
        - one of `"raw_bytes"`
  - discriminator: `type`
- `framing` (`test_schema.framing`; one of, optional, nullable)
  - one of the following:
    - `Newline`
      - `method` (`test_schema.framing.1.method`; string, required)
        - one of `"newline"`
      - `max_line_length` (`test_schema.framing.1.max_line_length`; integer, optional, nullable)
        - format: `int64` · minimum: `0`
  - discriminator: `method`
- `inferred` (`test_schema.inferred`; boolean, optional, nullable)
- `primary_keys` (`test_schema.primary_keys`; array of string, optional)

## Example request

```json
{
  "bad_data": {
    "behavior": "fail"
  },
  "definition": {
    "schema": "string",
    "type": "json_schema"
  },
  "fields": [
    {
      "type": "int32",
      "metadata_key": "string",
      "name": "string",
      "required": true
    }
  ],
  "format": {
    "compression": "uncompressed",
    "confluent_schema_registry": true,
    "debezium": true,
    "decimal_encoding": "number",
    "include_schema": true,
    "schema_id": 0,
    "timestamp_format": "rfc3339",
    "unstructured": true,
    "type": "json"
  },
  "framing": {
    "max_line_length": 0,
    "method": "newline"
  },
  "inferred": true,
  "primary_keys": [
    "string"
  ]
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url http://localhost:5115/api/v1/connection_tables/schemas/test \
  --header 'Content-Type: application/json' \
  --data '
{
  "bad_data": {
    "behavior": "fail"
  },
  "definition": {
    "schema": "string",
    "type": "json_schema"
  },
  "fields": [
    {
      "type": "int32",
      "metadata_key": "string",
      "name": "string",
      "required": true
    }
  ],
  "format": {
    "compression": "uncompressed",
    "confluent_schema_registry": true,
    "debezium": true,
    "decimal_encoding": "number",
    "include_schema": true,
    "schema_id": 0,
    "timestamp_format": "rfc3339",
    "unstructured": true,
    "type": "json"
  },
  "framing": {
    "max_line_length": 0,
    "method": "newline"
  },
  "inferred": true,
  "primary_keys": [
    "string"
  ]
}
'
```

### TypeScript

```typescript
const url = 'http://localhost:5115/api/v1/connection_tables/schemas/test';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    bad_data: {behavior: 'fail'},
    definition: {schema: 'string', type: 'json_schema'},
    fields: [{type: 'int32', metadata_key: 'string', name: 'string', required: true}],
    format: {
      compression: 'uncompressed',
      confluent_schema_registry: true,
      debezium: true,
      decimal_encoding: 'number',
      include_schema: true,
      schema_id: 0,
      timestamp_format: 'rfc3339',
      unstructured: true,
      type: 'json'
    },
    framing: {max_line_length: 0, method: 'newline'},
    inferred: true,
    primary_keys: ['string']
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "http://localhost:5115/api/v1/connection_tables/schemas/test"

payload = {
    "bad_data": { "behavior": "fail" },
    "definition": {
        "schema": "string",
        "type": "json_schema"
    },
    "fields": [
        {
            "type": "int32",
            "metadata_key": "string",
            "name": "string",
            "required": True
        }
    ],
    "format": {
        "compression": "uncompressed",
        "confluent_schema_registry": True,
        "debezium": True,
        "decimal_encoding": "number",
        "include_schema": True,
        "schema_id": 0,
        "timestamp_format": "rfc3339",
        "unstructured": True,
        "type": "json"
    },
    "framing": {
        "max_line_length": 0,
        "method": "newline"
    },
    "inferred": True,
    "primary_keys": ["string"]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Schema is valid


Source: https://www.arroyo.dev/docs/api/test-schema/index.md
