Package: effect
Module: SchemaIssue
Represents a schema issue produced when the input has the correct type but its value violates a constraint (e.g. a string that is too short, a number out of range).
When to use
Use when you need to detect constraint violations from Schema.filter,
Schema.minLength, Schema.greaterThan, or similar checks.
Details
actual is Option.some(value) when the failing value is known, or
Option.none() when absent.annotations optionally carries a message string for formatting."Invalid data <actual>" unless a
custom message annotation is provided.Example (Returning InvalidValue from a custom filter)
import { Option, SchemaIssue } from "effect"
const issue = new SchemaIssue.InvalidValue(
Option.some(""),
{ message: "must not be empty" }
)
console.log(String(issue))
// "must not be empty"
See
InvalidType — the input has the wrong type entirelyFilter — composite wrapper when a schema filter produces this issueSignature
declare class InvalidValue { constructor(
/**
* The value that caused the issue.
*/
actual: Option.Option<unknown>,
/**
* The metadata for the issue.
*/
annotations?: Schema.Annotations.Issue | undefined
) }
Since v4.0.0