Skip to content

Support noExcess codecs in toJsonSchema - #709

Open
eajoyce wants to merge 4 commits into
mainfrom
eajoyce/lak-4588-tojsonschema-noexcess
Open

eajoyce wants to merge 4 commits into
mainfrom
eajoyce/lak-4588-tojsonschema-noexcess

Conversation

@eajoyce

@eajoyce eajoyce commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Note

toJsonSchema now converts noExcess codecs.

Related Issues

  • Ref LAK-4588

Summary

  • noExcess(codec) used to fall through to unhandledType and become {}. NoExcessType is now part of MappableType and gets its own branch.
  • The branch converts the wrapped codec and sets additionalProperties: false on that object only. Nested objects keep the caller's strict setting, which matches the runtime check in noExcess.
  • A wrapped intersection is merged into one object schema first. additionalProperties: false on each allOf member would otherwise reject the other members' keys.
  • The merge logic is shared with the existing alwaysIncludeRequired intersection path through a new mergeObjectSchemas helper. That path's output is unchanged.
  • Minor changeset for @transcend-io/type-utils.

A noExcess wrapper became an empty schema, and a strict intersection
became allOf members that reject each other's keys. Read the wrapper
and merge those members into one object.

Co-authored-by: Cursor <cursoragent@cursor.com>
@linear-code

linear-code Bot commented Nov 5, 2026

Copy link
Copy Markdown

LAK-4588

@pkg-pr-new

pkg-pr-new Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@transcend-io/airgap.js-types

pnpm add https://pkg.pr.new/@transcend-io/airgap.js-types@9af0e7a
yarn add https://pkg.pr.new/@transcend-io/airgap.js-types@9af0e7a.tgz

@transcend-io/cli

pnpm add https://pkg.pr.new/@transcend-io/cli@9af0e7a
yarn add https://pkg.pr.new/@transcend-io/cli@9af0e7a.tgz

@transcend-io/custom-function-types

pnpm add https://pkg.pr.new/@transcend-io/custom-function-types@9af0e7a
yarn add https://pkg.pr.new/@transcend-io/custom-function-types@9af0e7a.tgz

@transcend-io/design-tokens

pnpm add https://pkg.pr.new/@transcend-io/design-tokens@9af0e7a
yarn add https://pkg.pr.new/@transcend-io/design-tokens@9af0e7a.tgz

@transcend-io/internationalization

pnpm add https://pkg.pr.new/@transcend-io/internationalization@9af0e7a
yarn add https://pkg.pr.new/@transcend-io/internationalization@9af0e7a.tgz

@transcend-io/privacy-types

pnpm add https://pkg.pr.new/@transcend-io/privacy-types@9af0e7a
yarn add https://pkg.pr.new/@transcend-io/privacy-types@9af0e7a.tgz

@transcend-io/sdk

pnpm add https://pkg.pr.new/@transcend-io/sdk@9af0e7a
yarn add https://pkg.pr.new/@transcend-io/sdk@9af0e7a.tgz

@transcend-io/secret-value

pnpm add https://pkg.pr.new/@transcend-io/secret-value@9af0e7a
yarn add https://pkg.pr.new/@transcend-io/secret-value@9af0e7a.tgz

@transcend-io/type-utils

pnpm add https://pkg.pr.new/@transcend-io/type-utils@9af0e7a
yarn add https://pkg.pr.new/@transcend-io/type-utils@9af0e7a.tgz

@transcend-io/utils

pnpm add https://pkg.pr.new/@transcend-io/utils@9af0e7a
yarn add https://pkg.pr.new/@transcend-io/utils@9af0e7a.tgz

commit: 9af0e7a

eajoyce and others added 2 commits November 6, 2026 11:10
Supporting noExcess in toJsonSchema is a new capability, not a fix
to existing schema output.

Co-authored-by: Cursor <cursoragent@cursor.com>
A record or refinement member stayed an open allOf, so the schema allowed keys that noExcess rejects.

Co-authored-by: Cursor <cursoragent@cursor.com>
@eajoyce eajoyce changed the title Teach toJsonSchema about noExcess Add support for custom io-ts type noExcess toJsonSchema codec to schema converter Nov 6, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
@eajoyce eajoyce changed the title Add support for custom io-ts type noExcess toJsonSchema codec to schema converter Support noExcess codecs in toJsonSchema Nov 6, 2026
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