Libraries
    Preparing search index...

    Type Alias ObjectSchemaValidationResult<T, TRootSchema, TSchema>

    ObjectSchemaValidationResult: Omit<ValidationResult<T>, "errors"> & {
        errors?: ValidationError[];
        getErrorsFor<TPropertySchema, TParentPropertyDescriptor>(
            selector?: (
                properties: PropertyDescriptorTree<TSchema, TRootSchema>,
            ) => PropertyDescriptor<
                TRootSchema,
                TPropertySchema,
                TParentPropertyDescriptor,
            >,
        ): TPropertySchema extends ObjectSchemaBuilder<
            any,
            any,
            any,
            any,
            any,
            any,
            any,
        >
            ? PropertyValidationResult<
                TPropertySchema,
                TRootSchema,
                TParentPropertyDescriptor,
            >
            : NestedValidationResult<
                TPropertySchema,
                TRootSchema,
                TParentPropertyDescriptor,
            >;
        getInvalidProperties(): readonly NestedValidationResult<
            any,
            TRootSchema,
            any,
        >[];
    }

    Type Parameters

    Type Declaration

    • Optionalerrors?: ValidationError[]

      A flat list of validation errors.

      Use getErrorsFor() instead for per-property error inspection with type-safe property selectors. The errors array on ObjectSchemaBuilder validation results will be removed in a future major version.

    • getErrorsFor: function
      • Returns a nested validation error for the property selected by the selector function. This is the recommended way to inspect validation errors — it provides type-safe, per-property error details including isValid, errors, and seenValue.

        Prefer this over the deprecated errors array.

        Type Parameters

        • TPropertySchema
        • TParentPropertyDescriptor

        Parameters

        Returns TPropertySchema extends ObjectSchemaBuilder<any, any, any, any, any, any, any>
            ? PropertyValidationResult<
                TPropertySchema,
                TRootSchema,
                TParentPropertyDescriptor,
            >
            : NestedValidationResult<
                TPropertySchema,
                TRootSchema,
                TParentPropertyDescriptor,
            >

    • getInvalidProperties: function
      • Returns a list of all property validation results that have direct validation errors. Each entry exposes .descriptor (with .toJsonPointer() for the property's path) and .errors.

        This is useful for collecting all errors with their full JSON Pointer paths, e.g. for building RFC 9457 Problem Details responses.

        Returns readonly NestedValidationResult<any, TRootSchema, any>[]