---
canonical: https://amplience.com/developers/docs/schema-reference/schema-examples/core-concepts/validations/
title: Validation
description: As part of the Amplience schema examples, this schema example demonstrates various validations available for text, numbers and arrays, and how to use.
  interactive: true
  - Schema examples
audience: Developer
date_published: 2026-04-13
date_modified: 2026-04-14
---

# Validation schema example

This schema example demonstrates various validations available for text, numbers and arrays.

- The `simplestringwithmaxandmin` property uses `minLength` and `maxLength` to constrain the length of the string. This property is also included in the properties listed as required, so a valid value must be entered in the property before it can be saved.

- The `dateWithPattern` and `urlslug` properties demonstrate how to constrain the value entered using a regular expression defined by the pattern keyword. You can find out more about regular expressions in JSON Schema in the [JSON Schema documentation](https://json-schema.org/understanding-json-schema/reference/regular_expressions.html).

- The `numbervalidationexample` shows how to use the multipleOf keyword, for a number that must be a multiple of 10

- The `stringlistofenums` demonstrates how to use an enum to constrain the values that can be added to a list. The `uniqueItems` keyword is also used to ensure that each value can only be chosen once. This property is also required, so a valid value must be entered before the the content item can be saved. Users have a choice of selecting "none" if the array uses an enum.

- The `stringArray` must contain a string with a length of 10 or more characters - validated using the `contains` keyword.

- The `numberArray` property must contain an integer with a value of at least 10 - validated using the `contains` keyword.

## Pre-requisites

None. This is a self contained schema.

## How to use

You can use the validations demonstrated in this schema for your own properties.

## Validations example

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schema-examples.com/combined-validation",
  "title": "Combined validation schema",
  "description": "Combined examples of standard and next generation validation features",
  "$comment": "Docs: https://amplience.com/developers/docs/next-gen-authoring/schema-examples/#validation",
  "allOf": [
    {
      "$ref": "http://bigcontent.io/cms/schema/v1/core#/definitions/content"
    }
  ],
  "type": "object",
  "properties": {
    "simplestringwithmaxandmin": {
      "title": "Simple string with maximum length",
      "description": "A string that can contain between 4 and 255 characters",
      "type": "string",
      "minLength": 4,
      "maxLength": 255
    },
    "datewithpatternvalidation": {
      "title": "Date validated with a pattern",
      "description": "Creation date (YYYY-MM-DD)",
      "type": "string",
      "minLength": 10,
      "maxLength": 10,
      "pattern": "^[0-9]{4}-((0[1-9])|(1[0-2]))-((0[1-9])|([1-2][0-9])|(3[0-1]))$"
    },
    "urlslugpatternvalidation": {
      "title": "URL slug",
      "description": "URL slug (a-z and 0-9)",
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "pattern": "^[a-z0-9-]+$"
    },
    "numbervalidationexample": {
      "title": "Number validation example",
      "description": "Enter a rating between 10- 100. (must be a multiple of 10)",
      "type": "integer",
      "minimum": 10,
      "maximum": 100,
      "multipleOf": 10
    },
    "stringlistofenums": {
      "title": "Strings defined in enum",
      "description": "Choose up to 3 string values",
      "type": "array",
      "minItems": 0,
      "maxItems": 3,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "Electrics",
          "Home",
          "Kitchen",
          "Lighting",
          "Computers"
        ]
      }
    },
    "stringArray": {
      "title": "String array",
      "description": "An array of strings that must contain an item with a minimum of 10 characters",
      "type": "array",
      "minItems": 0,
      "maxItems": 10,
      "items": {
        "type": "string"
      },
      "contains": {
        "type": "string",
        "minLength": 10
      }
    },
    "numberArray": {
      "title": "Number array",
      "description": "An array of numbers that must contain at least one number with a minimum value of 10 or more",
      "type": "array",
      "minItems": 0,
      "maxItems": 10,
      "items": {
        "type": "number"
      },
      "contains": {
        "type": "number",
        "minimum": 10
      }
    }
  },
  "propertyOrder": [
    "simplestringwithmaxandmin",
    "datewithpatternvalidation",
    "urlslugpatternvalidation",
    "numbervalidationexample",
    "stringlistofenums",
    "stringArray",
    "numberArray"
  ],
  "required": [
    "simplestringwithmaxandmin",
    "datewithpatternvalidation",
    "urlslugpatternvalidation",
    "numbervalidationexample",
    "stringlistofenums",
    "stringArray",
    "numberArray"
  ]
}
```

## Related Pages

[Validations](https://amplience.com/developers/docs/schema-reference/validation)
