Effect CommunityEC
Effect Community5mo ago
8 replies
gavlois

Generating a JSON Schema for this schema requires a "jsonSchema" annotation

Hello, I'm using Schema.Class to define a shape that is returned from my database using the SQL package. Some of the fields are date fields such as created_at and the Schema type I'm using is DateFromSelf, but I get this error when I try to run:

$ bun src/program.ts --watch
295 |   if (Option.isSome(surrogate)) {
296 |     return go(surrogate.value, $defs, handleIdentifier, path, options);
297 |   }
298 |   switch (ast._tag) {
299 |     case "Declaration":
300 |       throw new Error(errors_.getJSONSchemaMissingAnnotationErrorMessage(path, ast));

error: Missing annotation
at path: ["created_at"]
details: Generating a JSON Schema for this schema requires a "jsonSchema" annotation
schema (Declaration): DateFromSelf

Any idea on what I might be doing wrong here?
Was this page helpful?