Skip to content

webapi-openapi: the concrete registry emits a typed request (dhall-do-api's cbRequest) - #45

Merged
mageshb merged 1 commit into
masterfrom
typed-concrete-registry
Sep 7, 2026
Merged

mageshb merged 1 commit into
masterfrom
typed-concrete-registry

Conversation

@mageshb

@mageshb mageshb commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Companion to byteally/dhall-do-api#typed-concrete-bindings (zenbridge design Typed Bindings and Unset Fields, D1).

A curated default (naming map: request part → field → a Haskell expression) used to splice into the generated registry as a Dhall record built at step time (cbDefaults = pure (recPart …)). The emission becomes

cbRequest = setBody (setField @"links" (Const (mempty :: Vector NsLink)) unsetRecord) (emptyRequest)

so the field name and the value's type are checked by GHC against the generated contract record. The naming map's value is the field's VALUE now (no fromHsLit). The generated module gains TypeApplications and loses its Dhall imports and the recPart helper. Regenerating zenbridge's NetSuite currency slice with the curated map changed only ConcreteRegistry.hs (zero drift elsewhere); its ns-run gate is green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CGPoFpp1qwGzBaiEUmmUW5

…-api's cbRequest), not Dhall defaults

A curated default (naming map: request part -> field -> a Haskell
expression) used to splice into the registry as a Dhall record built at
step time (cbDefaults = pure (recPart …)). dhall-do-api-webapi's bindings
now author a typed request (design "Typed Bindings and Unset Fields",
D1): the emission becomes

  cbRequest = setBody (setField @"links" (Const (mempty :: Vector NsLink)) unsetRecord) (emptyRequest)

so the field name and the value's type are checked by GHC against the
generated contract record. The naming map's value is the field's VALUE
now (no fromHsLit). The generated module gains TypeApplications and loses
its Dhall imports and the recPart helper.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CGPoFpp1qwGzBaiEUmmUW5
@mageshb
mageshb merged commit c4fb3f0 into master Sep 7, 2026
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant