Documentation
    Preparing search index...

    String type schema.

    Represents a JSON Schema string type with format validation, pattern matching, and length constraints. Maps to TypeScript string type with optional semantic format annotations.

    interface IString {
        contentMediaType?: string;
        default?: string;
        deprecated?: boolean;
        description?: string;
        enum?: string[];
        example?: any;
        examples?: Record<string, any>;
        format?:
            | "byte"
            | "password"
            | "regex"
            | "uuid"
            | "email"
            | "hostname"
            | "idn-email"
            | "idn-hostname"
            | "iri"
            | "iri-reference"
            | "ipv4"
            | "ipv6"
            | "uri"
            | "uri-reference"
            | "uri-template"
            | "url"
            | "date-time"
            | "date"
            | "time"
            | "duration"
            | "json-pointer"
            | "relative-json-pointer"
            | string & {}
            | "binary";
        maxLength?: number & tags.Type<"uint64">;
        minLength?: number & tags.Type<"uint64">;
        pattern?: string;
        readOnly?: boolean;
        title?: string;
        type: "string";
        writeOnly?: boolean;
    }

    Hierarchy (View Summary)

    Index

    Properties

    contentMediaType?: string

    MIME type of the string content.

    Indicates the content type when the string contains encoded binary data, such as "application/json" or "image/png".

    default?: string

    Default value when not provided.

    The string to use when the LLM omits this parameter.

    deprecated?: boolean

    Whether this type is deprecated.

    When true, indicates the type should no longer be used and may be removed in future versions. Set via the @deprecated JSDoc tag.

    description?: string

    Detailed description of the schema.

    Full documentation for the type, explaining its purpose, constraints, and usage. Extracted from JSDoc comment body. Supports markdown formatting in many JSON Schema consumers.

    enum?: string[]

    Allowed string values.

    Restricts the value to specific string literals. Maps directly to TypeScript string literal union types.

    example?: any

    Single example value for the schema.

    A representative value that conforms to the schema, useful for documentation and testing. Set via the @example JSDoc tag.

    examples?: Record<string, any>

    Named example values for the schema.

    Multiple examples as key-value pairs, where keys are example names and values are conforming data. Useful for showing different valid states or edge cases.

    format?:
        | "byte"
        | "password"
        | "regex"
        | "uuid"
        | "email"
        | "hostname"
        | "idn-email"
        | "idn-hostname"
        | "iri"
        | "iri-reference"
        | "ipv4"
        | "ipv6"
        | "uri"
        | "uri-reference"
        | "uri-template"
        | "url"
        | "date-time"
        | "date"
        | "time"
        | "duration"
        | "json-pointer"
        | "relative-json-pointer"
        | string & {}
        | "binary"

    Semantic format specifier.

    Indicates the string represents a specific format like email, UUID, or date-time. LLMs may use this to generate appropriate values. Common formats include "email", "uri", "uuid", "date-time".

    maxLength?: number & tags.Type<"uint64">

    Maximum string length.

    The string must have at most this many characters.

    minLength?: number & tags.Type<"uint64">

    Minimum string length.

    The string must have at least this many characters.

    pattern?: string

    Regular expression pattern for validation.

    The string must match this regex pattern. Note that LLMs may struggle with complex regex patterns; simple patterns work best.

    readOnly?: boolean

    Whether the property is read-only.

    When true, the property should not be modified by clients and is typically set by the server. Useful for generated IDs, timestamps, etc.

    title?: string

    Short title for the schema.

    A brief, human-readable name for the type. Typically extracted from the first line of a JSDoc comment or the @title tag.

    type: "string"
    writeOnly?: boolean

    Whether the property is write-only.

    When true, the property is accepted on input but never returned in responses. Common for sensitive data like passwords.