Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IValueSchemaProvider

    Provides schema information about the values a property editor accepts.

    Namespace: Umbraco.Cms.Core.PropertyEditors
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IValueSchemaProvider
    Remarks

    This interface is opt-in for property editors that want to expose their value schema for programmatic content creation, validation, and tooling support.

    Implementations should return the schema for the incoming value (what IDataValueEditor.FromEditor receives via ContentPropertyData.Value), not the stored/database model (what IDataValueEditor.FromEditor produces) or the published model (what IPropertyValueConverter produces).

    Methods

    View Source

    GetValueSchema(object?)

    Gets a JSON Schema (draft 2020-12) describing the incoming value structure.

    Declaration
    JsonObject? GetValueSchema(object? configuration)
    Parameters
    Type Name Description
    object configuration

    The data type configuration, which may affect the schema.

    Returns
    Type Description
    JsonObject

    A System.Text.Json.Nodes.JsonObject containing a valid JSON Schema, or null if the schema cannot be generated for the given configuration.

    Remarks

    The returned schema should describe the structure that IDataValueEditor.FromEditor receives (i.e., what the Management API accepts).

    For configuration-dependent schemas (e.g., BlockList with specific element types), the schema should reflect the constraints defined in the configuration.

    View Source

    GetValueType(object?)

    Gets the CLR type that represents the incoming value structure.

    Declaration
    Type? GetValueType(object? configuration)
    Parameters
    Type Name Description
    object configuration

    The data type configuration, which may affect the value type.

    Returns
    Type Description
    Type

    The CLR type of the incoming value, or null if the type cannot be determined or varies significantly based on configuration.

    Remarks

    For simple editors (e.g., textbox), this might return string. For complex editors (e.g., MediaPicker3), this returns the DTO type that the editor submits. For block-based editors where the structure is entirely configuration-dependent, this may return null.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX