Skip to content

Carry resolver docs and default value strategies in the official plugins - #192

Merged
lorisleiva merged 1 commit into
mainfrom
document-resolver-docs-and-strategies
Oct 5, 2026
Merged

lorisleiva merged 1 commit into
mainfrom
document-resolver-docs-and-strategies

Conversation

@lorisleiva

Copy link
Copy Markdown
Member

This PR lets the official plugins keep two pieces of v1 information that renderers need when upgrading resolvers and extra arguments:

  • The codama.resolver payload gains an optional docs field describing the resolver: { name, dependsOn?, docs? }.
  • The codama.extraArgument payload gains an optional defaultValueStrategy, as for struct fields: { identifier, type, defaultValue?, defaultValueStrategy?, docs? }.
  • structFieldTypeNode.defaultValueStrategy now also applies when a codama.resolver plugin resolves the field. For example, omitted keeps a resolved field out of generated inputs, as renderers already do for v1 resolver defaults.
structFieldTypeNode({
    identifier: 'tags',
    type: integerTypeNode('u8'),
    defaultValueStrategy: 'omitted',
    plugins: [pluginNode('codama.resolver', { payload: { name: 'resolveTags', docs: 'Derives tags from the name.' } })],
});

@lorisleiva
lorisleiva marked this pull request as ready for review October 5, 2026 11:27
@lorisleiva
lorisleiva merged commit f775857 into main Oct 5, 2026
3 checks passed
@lorisleiva
lorisleiva deleted the document-resolver-docs-and-strategies branch October 5, 2026 11:27
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