webapi-openapi: the concrete registry emits a typed request (dhall-do-api's cbRequest) - #45
Merged
Merged
Conversation
…-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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 becomesso 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 gainsTypeApplicationsand loses its Dhall imports and therecParthelper. Regenerating zenbridge's NetSuite currency slice with the curated map changed onlyConcreteRegistry.hs(zero drift elsewhere); its ns-run gate is green.🤖 Generated with Claude Code
https://claude.ai/code/session_01CGPoFpp1qwGzBaiEUmmUW5