---
title: Validation constraint test
slug: validation-constraint-test
docTags: 
createdAt: 2026-04-17T07:48:39.600Z
---

{
  "id": "5WuHdOfD4GVjxX7CNpaSc",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.archbee.com/v2/validation/test",
    "servers": [
      {
        "url": "https://api.archbee.com/v2/validation/test",
        "description": "Production server"
      },
      {
        "url": "https://staging-api.archbee.com/v2/validation/test",
        "description": "Staging server"
      },
      {
        "url": "https://{region}.api.archbee.com/{version}/validation/test",
        "description": "Regional server with variables"
      }
    ],
    "name": "Validation constraint test",
    "description": "A test endpoint that exercises every validation constraint supported\nby OpenAPI 3.0. Inspect the request body schema for all constraints.\n",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Schema exercising every validation constraint",
          "customType": "ValidationTest",
          "schema": [
            {
              "name": "requiredString",
              "kind": "required",
              "type": "string",
              "description": "A required string with length constraints",
              "example": "hello",
              "minLength": 3,
              "maxLength": 50
            },
            {
              "name": "patternString",
              "kind": "optional",
              "type": "string",
              "description": "Must match pattern XX-1234",
              "example": "AB-1234",
              "pattern": "^[A-Z]{2}-\\d{4}$"
            },
            {
              "name": "enumString",
              "kind": "optional",
              "type": "string<option_a | option_b | option_c>",
              "description": "Must be one of the allowed values",
              "example": "",
              "default": "option_a",
              "enum": [
                "option_a",
                "option_b",
                "option_c"
              ]
            },
            {
              "name": "requiredNumber",
              "kind": "required",
              "type": "number<double>",
              "description": "A number between 0 and 1000 (inclusive)",
              "example": 42.5,
              "format": "double",
              "minimum": 0,
              "maximum": 1000
            },
            {
              "name": "exclusiveNumber",
              "kind": "optional",
              "type": "number<float>",
              "description": "A number between 0 and 100 (exclusive on both ends)",
              "example": 50,
              "format": "float",
              "minimum": 0,
              "maximum": 100
            },
            {
              "name": "multipleOfNumber",
              "kind": "optional",
              "type": "integer<int32>",
              "description": "Must be a multiple of 5 between 0 and 100",
              "example": 25,
              "format": "int32",
              "minimum": 0,
              "maximum": 100
            },
            {
              "name": "requiredArray",
              "kind": "required",
              "type": "array",
              "description": "An array with 1-10 unique string items",
              "example": "[\"alpha\",\"beta\",\"gamma\"]",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "fixedSizeArray",
              "kind": "optional",
              "type": "array",
              "description": "Must contain exactly 3 integers",
              "example": "",
              "itemType": "integer",
              "customType": "integer[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "nullableField",
              "kind": "optional",
              "type": "string",
              "description": "This field can be explicitly set to null",
              "example": ""
            },
            {
              "name": "nestedObject",
              "kind": "optional",
              "type": "object",
              "description": "A nested object with its own required field",
              "example": "",
              "schema": [
                {
                  "name": "key",
                  "kind": "required",
                  "type": "string",
                  "description": "",
                  "example": "",
                  "minLength": 1
                },
                {
                  "name": "value",
                  "kind": "optional",
                  "type": "string",
                  "description": "",
                  "example": ""
                }
              ]
            },
            {
              "name": "flagField",
              "kind": "optional",
              "type": "boolean",
              "description": "A boolean flag with default value",
              "example": "",
              "default": false
            }
          ],
          "modelRef": "#/components/schemas/ValidationTest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "bearerAuth",
          "name": "bearerAuth",
          "kind": "optional",
          "type": "http",
          "description": "<p>HTTP Bearer token authentication (JWT)</p>",
          "scheme": "bearer"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Validation passed",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "valid",
                "kind": "optional",
                "type": "boolean",
                "description": "",
                "example": true
              },
              {
                "name": "processedFields",
                "kind": "optional",
                "type": "integer",
                "description": "",
                "example": 15
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "422",
        "description": "Unprocessable entity — validation failed",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"code\":\"VALIDATION_ERROR\",\"message\":\"The request body failed validation\",\"details\":[{\"field\":\"price\",\"message\":\"must be greater than 0\",\"code\":\"INVALID_VALUE\"},{\"field\":\"name\",\"message\":\"must be between 1 and 200 characters\",\"code\":\"INVALID_LENGTH\"}]}",
            "description": "Standard error response",
            "customType": "Error",
            "schema": [
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": "Machine-readable error code",
                "example": "VALIDATION_ERROR"
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Human-readable error message",
                "example": "The request body contains invalid fields"
              },
              {
                "name": "details",
                "kind": "optional",
                "type": "array",
                "description": "Detailed validation errors (when applicable)",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "field",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "email"
                  },
                  {
                    "name": "message",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "must be a valid email address"
                  },
                  {
                    "name": "code",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "INVALID_FORMAT"
                  }
                ]
              },
              {
                "name": "requestId",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "Correlation ID for support inquiries",
                "example": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "T6OZAxcMWdGmp0ayU53AO",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.archbee.com/v2/validation/test \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"requiredString\": \"hello\",\n     \"enumString\": \"option_a\",\n     \"requiredNumber\": 42.5,\n     \"requiredArray\": [],\n     \"nestedObject\": {\n     \"key\": \"\"\n     }\n     }'"
        },
        {
          "id": "Pt9R4TDo5qNAXjvbgMGK4",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"requiredString\": \"hello\",\n   \"enumString\": \"option_a\",\n   \"requiredNumber\": 42.5,\n   \"requiredArray\": [],\n   \"nestedObject\": {\n      \"key\": \"\"\n   }\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.archbee.com/v2/validation/test\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "pt0XngkG38Dh1Pc_NvsQx",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.archbee.com/v2/validation/test\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"requiredString\": \"hello\",\n   \"enumString\": \"option_a\",\n   \"requiredNumber\": 42.5,\n   \"requiredArray\": [],\n   \"nestedObject\": {\n      \"key\": \"\"\n   }\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "d73Kbw8rsISJMtXJLOW9V",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.archbee.com/v2/validation/test\"\n\npayload = json.dumps({\n   \"requiredString\": \"hello\",\n   \"enumString\": \"option_a\",\n   \"requiredNumber\": 42.5,\n   \"requiredArray\": [],\n   \"nestedObject\": {\n      \"key\": \"\"\n   }\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "T6OZAxcMWdGmp0ayU53AO"
    },
    "results": {
      "languages": [
        {
          "id": "sd4NBRByFSadoVnuQYa4g",
          "language": "200",
          "code": "// Validation passed\n{\n  \"valid\": true,\n  \"processedFields\": 15\n}"
        },
        {
          "id": "sleU5i_pmiMFA1FPg5gTC",
          "language": "422",
          "code": "// Unprocessable entity — validation failed\n{\n  \"code\": \"VALIDATION_ERROR\",\n  \"message\": \"The request body contains invalid fields\",\n  \"details\": [\n    {\n      \"field\": \"email\",\n      \"message\": \"must be a valid email address\",\n      \"code\": \"INVALID_FORMAT\"\n    }\n  ],\n  \"requestId\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "sd4NBRByFSadoVnuQYa4g"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}