# String

Represents JS primitive type `string`.

```javascript
{
    "type": "string"
}
```

#### Format

The `format` keyword allows for basic semantic validation on certain kinds of string values that are commonly used. This allows values to be constrained beyond what [Regular Expressions](https://json-schema.org/understanding-json-schema/reference/regular_expressions.html#regular-expressions) can do.

Possible values:

date, email, hostname, uri, uri-reference, ipv4, ipv6, mac, date-time, time, egex, color, credit-card, phone.&#x20;

```
{
  "$theme": "rounded/blue",
  "schema": {
    "type": "object",
    "properties": {
      "email": {
         "type": "string",
         "format": "email"
      }
    }
  },
  "layout": {
    "type": "div",
    "items": [{
        "key": "email"
    }]
  }
}
```

#### Minimum Length

&#x20;The keyword for setting minimal length on string prop is `minLength`. The value of this keyword MUST be a non-negative integer.&#x20;

A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword. The length of a string instance is defined as the number of its characters as defined by RFC 7159 \[RFC7159].

Omitting this keyword has the same behavior as a value of 0.

```
{
"$theme": "rounded/blue",
  "schema": {
     "type": "object",
     "properties": {
        "example": {
           "type": "string",
           "minLength": "5"
       }
     }
  },
  "layout": {
    "type": "div",
    "items": [{
        "key": "example"
    }]
  }
}
```

#### Maximum Length

&#x20;The keyword for setting maximal length on string prop is `maxLength`. The value of this keyword MUST be a non-negative integer.&#x20;

A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword. The length of a string instance is defined as the number of its characters as defined by RFC 7159 \[RFC7159].

```
{
"$theme": "rounded/blue",
  "schema": {
     "type": "object",
     "properties": {
        "example": {
           "type": "string",
           "maxLength": "5"
       }
     }
  },
  "layout": {
    "type": "div",
    "items": [{
        "key": "example"
    }]
  }
}
```

#### Pattern

The keyword for setting pattern is `pattern`.

The value of this keyword MUST be a string. This string SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect. A string instance is considered valid if the regular expression matches the instance successfully. Recall: regular expressions are not implicitly anchored.

```
{
"$theme": "rounded/blue",
  "schema": {
     "type": "object",
     "properties": {
        "example": {
           "type": "string",
           "pattern": "[A-Z][1-9][a-z]"
       }
     }
  },
  "layout": {
    "type": "div",
    "items": [{
        "key": "example"
    }]
  }
}
```

#### Secret

The keyword for setting secret is `secret`.

The value of this keyword MUST be a boolean - true or false.&#x20;

```
{
"$theme": "rounded/blue",
  "schema": {
     "type": "object",
     "properties": {
        "example": {
           "type": "string",
           "secret": true
       }
     }
  },
  "layout": {
    "type": "div",
    "items": [{
        "key": "example"
    }]
  }
}
```

#### Multiline

The keyword for setting multiline is `multiline`.

The value of this keyword can be either boolean or number. Number value controls quantity of rows to be displayed.

```
{
"$theme": "rounded/blue",
  "schema": {
     "type": "object",
     "properties": {
        "example": {
           "type": "string",
           "multiline": 6
       }
     }
  },
  "layout": {
    "type": "div",
    "items": [{
        "key": "example"
    }]
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jsf.gitbook.io/jsf/schema/property-types/string.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
