UnexpectedKeyRepresents a schema issue produced when an input object or tuple contains a key/index not declared by the schema.
When to use
Use when you need to detect excess properties during strict struct/tuple validation.
Details
actualis the raw value at the unexpected key (plainunknown).astis the schema that was being validated against.annotationsonastmay contain a custommessageUnexpectedKey.
Source effect/SchemaIssue.ts:35826 lines
export class class UnexpectedKeyclass UnexpectedKey {
_tag: 'UnexpectedKey';
ast: SchemaAST.AST;
actual: unknown;
toString: (this: Issue) => string;
}
Represents a schema issue produced when an input object or tuple contains a key/index not
declared by the schema.
When to use
Use when you need to detect excess properties during strict struct/tuple
validation.
Details
actual is the raw value at the unexpected key (plain unknown).
ast is the schema that was being validated against.
annotations on ast may contain a custom messageUnexpectedKey.
UnexpectedKey extends class BaseBase {
readonly UnexpectedKey._tag: "UnexpectedKey"_tag = "UnexpectedKey"
/**
* The schema that caused the issue.
*/
readonly UnexpectedKey.ast: SchemaAST.ASTThe schema that caused the issue.
ast: import SchemaASTSchemaAST.type SchemaAST.AST = /*unresolved*/ anyAST
/**
* The input value that caused the issue.
*/
readonly UnexpectedKey.actual: unknownThe input value that caused the issue.
actual: unknown
constructor(
/**
* The schema that caused the issue.
*/
ast: SchemaAST.ASTThe schema that caused the issue.
ast: import SchemaASTSchemaAST.type SchemaAST.AST = /*unresolved*/ anyAST,
/**
* The input value that caused the issue.
*/
actual: unknownThe input value that caused the issue.
actual: unknown
) {
super()
this.UnexpectedKey.ast: SchemaAST.ASTThe schema that caused the issue.
ast = ast: SchemaAST.ASTThe schema that caused the issue.
ast
this.UnexpectedKey.actual: unknownThe input value that caused the issue.
actual = actual: unknownThe input value that caused the issue.
actual
}
}Referenced by 3 symbols