atproto_sdl/lower/fields

Lowers everything at field position: object schemas, properties, array items, union members, and query/procedure/subscription params. This is where the AST’s position restrictions turn into Semantic errors (no inline objects in property/item position, no nested arrays, union members must be named refs, params are primitives only). lower.gleam and lower/methods.gleam both build on the exports here.

Values

pub fn closed_flag(closed: Bool) -> option.Option(Bool)
pub fn object_schema(
  fields: List(tree.Field),
  description: option.Option(String),
  ctx: scope.Ctx,
) -> Result(ast.ObjectSchema, error.ParseError)
pub fn params_schema(
  params: List(tree.Field),
  ctx: scope.Ctx,
) -> Result(option.Option(ast.ParamsSchema), error.ParseError)
pub fn to_item(
  ty: tree.SType,
  item_attrs: List(tree.Attr),
  ctx: scope.Ctx,
) -> Result(ast.ArrayItemType, error.ParseError)
pub fn union_member_from_stype(
  m: tree.SType,
  ctx: scope.Ctx,
) -> Result(String, error.ParseError)
pub fn union_member_ref(
  path: tree.RefPath,
  span: token.Span,
  ctx: scope.Ctx,
) -> Result(String, error.ParseError)
Search Document