@shopify/cli-kit
    Preparing search index...

    Function jsonSchemaValidate

    • Given a subject object and a JSON schema contract, validate the subject against the contract.

      Errors are returned in a zod-like format, and processed to better handle unions.

      Parameters

      • subject: object

        The object to validate.

      • schema: SchemaObject

        The JSON schema to validate against.

      • handleInvalidAdditionalProperties: HandleInvalidAdditionalProperties

        Whether to strip or fail on invalid additional properties.

      • Optionalidentifier: string

        The identifier of the schema being validated, used to cache the validator.

      Returns ParseConfigurationResult<unknown> & { rawErrors?: AjvError[] }

      The result of the validation. If the state is 'error', the errors will be in a zod-like format.