Vana SDK - v2.2.2
    Preparing search index...

    Interface Schema

    Schema with optional definition fields.

    Schemas define the structure and validation rules for user data processed by refiners. They ensure data quality and consistency across the Vana network by specifying how raw user data should be formatted, validated, and processed.

    When the definition has been fetched (via schemas.get() or schemas.list() with includeDefinitions), the version and schema fields will be populated. Otherwise, only the metadata fields are present.

    // Complete schema from schemas.get()
    const completeSchema: Schema = {
    id: 5,
    name: 'Social Media Profile',
    dialect: 'json',
    definitionUrl: 'ipfs://QmSchema...',
    version: '1.0.0',
    description: 'Schema for validating social media profile data',
    schema: { // JSON Schema object
    type: 'object',
    properties: {
    username: { type: 'string' }
    }
    }
    };

    // Metadata-only schema from schemas.list() without includeDefinitions
    const metadataSchema: Schema = {
    id: 5,
    name: 'Social Media Profile',
    dialect: 'json',
    definitionUrl: 'ipfs://QmSchema...'
    };
    interface Schema {
        id: number;
        name: string;
        dialect: "json" | "sqlite";
        definitionUrl: string;
        version?: string;
        description?: string;
        dialectVersion?: string;
        schema?: string | object;
    }

    Hierarchy (View Summary)

    Index

    Properties

    id: number

    Schema ID

    name: string

    Schema name

    dialect: "json" | "sqlite"

    Schema dialect ('json' or 'sqlite')

    definitionUrl: string

    URL containing the schema definition

    version?: string

    Version of the schema (present when definition is fetched)

    description?: string

    Optional description of the schema

    dialectVersion?: string

    Optional version of the dialect

    schema?: string | object

    The actual schema - JSON Schema object for 'json' dialect, DDL string for 'sqlite' (present when definition is fetched)