infra stuff in gleam

atproto_sdl: params array items reject format scalars (did: [Did]) that scalar params accept #36

Open mokkenstorm.dev
Open opened by mokkenstorm.dev

Found vendoring blue.microcosm.links.getBacklinks (fetched from microcosm's live com.atproto.lexicon.schema records). Converting to SDL and re-parsing fails:

getBacklinks.sdl:11:26: param array items must be string, integer, or boolean

Root cause in atproto_sdl/lower/fields.gleam: scalar_to_params_item handles SkString/SkInteger/SkBoolean but not SkFormat(_), while the scalar (non-array) param path scalar_to_params_property supports format-annotated strings (Did, Handle, ...) via ParamsString(...Some(fmt)).

So did: Did works as a query param but did: [Did] (array of DID-formatted strings) is rejected, even though the lexicon spec allows format on params array items. Workaround used: downgraded the param to did: [String] (wire-identical, format is validation/doc only).

Sign up or Sign in to add to the discussion.