Effect CommunityEC
Effect Community•2y ago•
19 replies
Max Khramtsov

Annotation Issues with Transformation and JSON Schema Generation

Is it expected that annotations on Transformation are not taken into account when generating json-schema? How then can I annotate the root json schema itself?
Schema.Struct({
  email: Schema.optional(EmailForm, { as: "Option", exact: true }) // without Schema.optional it works as expected
})
.annotations({
  title: "👤 Visitor",
  description: "description",
})
// produced json-schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {...},
  "additionalProperties": false,
  "title": "Struct (Encoded side)" // expected "👤 Visitor" + description
}
image.png
Was this page helpful?