If you get stuck, please try discussing the issue on the Effect Discord or posting a question to Stackoverflow.
If you’ve found a bug, or Effect can’t meet your needs, please try raising an issue.
Arbitrary
Arbitrary: Missing arbitrary annotation
This error occurs when trying to generate an Arbitrary instance for a schema that lacks a predefined way to generate sample values.
This commonly happens when the schema defines a custom type that the engine does not recognize.
To resolve this, add an arbitrary annotation that defines how to generate random instances of the custom type.
JSONSchema: Missing identifier annotation for recursive schemas
This error occurs when generating a JSON Schema for a recursive or mutually recursive schema that lacks an identifier annotation.
Recursive schemas need a unique identifier annotation to ensure correct references in the generated JSON Schema. Without it, the schema generator cannot resolve the self-referencing structure.
To resolve this, ensure that recursive schemas include an identifier annotation.
This error occurs when generating a JSON Schema for a tuple that includes post-rest elements, elements appearing after a rest parameter.
JSON Schema does not support this structure.
This error occurs when attempting to generate a JSON Schema for a structure that includes unsupported key types, such as symbol.
JSON Schema only supports string-based keys.
Example
1
import {
import Schema
Schema } from"effect"
2
3
// Schema with a symbol key (not allowed in JSON Schema)
4
const
constschema:Schema.Struct<{
[x:symbol]:typeof Schema.String;
}>
schema=
import Schema
Schema.
functionStruct<{
[x:symbol]:typeof Schema.String;
}>(fields: {
[x:symbol]:typeof Schema.String;
}):Schema.Struct<{
[x:symbol]:typeof Schema.String;
}> (+1overload)
@since ― 3.10.0
Struct({
5
[
var Symbol:SymbolConstructor
Symbol.
SymbolConstructor.for(key: string): symbol
Returns a Symbol object from the global symbol registry matching the given key if found.
Otherwise, returns a new symbol with this key.
@param ― key key to search for.
for("my-symbol")]:
import Schema
Schema.
classString
exportString
@since ― 3.10.0
String
6
})
as there is no way to represent this in JSON Schema.
Pretty
Pretty: Missing pretty annotation
This error occurs when trying to generate a Pretty instance for a schema that lacks a predefined way to compare values.
This commonly happens when the schema defines a custom type that the engine does not recognize.
To resolve this, add a pretty annotation that defines how to compare the custom type.