Skip to content

refactor(form): replace bespoke schema types with @types/json-schema - #28

Merged
colinjlacy merged 1 commit into
runtimeconditions:mainfrom
abhinavkdeval08-design:refactor/json-schema-types-27
Dec 2, 2026
Merged

colinjlacy merged 1 commit into
runtimeconditions:mainfrom
abhinavkdeval08-design:refactor/json-schema-types-27

Conversation

@abhinavkdeval08-design

Copy link
Copy Markdown
Member

Closes #27

Replaces the hand-rolled JsonSchemaProperty with JSONSchema7 from @types/json-schema.

What changed

  • Removed JsonSchemaProperty; ExtensionSchemaItem.schema and ConditionalRule now use JSONSchema7.
  • Added isSchemaObject() to narrow JSONSchema7Definition (which can be a boolean schema) before traversal.
  • @types/json-schema is in dependencies (not dev) because exported types reference it and .d.ts files are emitted. No runtime code is added.

Notes

  • No behavior change for object schemas. Boolean sub-schemas (true/false) are now skipped explicitly.
  • package-lock.json was regenerated with npm 10 (lockfileVersion 3, matches CI Node 20). Diff is limited to the new @types/json-schema entry plus npm 10 metadata (peer flags, root license).

Verification

  • tsc -p tsconfig.build.json --noEmit: 0 errors
  • Jest: 2 suites, 17/17 passing

Signed-off-by: Abhinav Deval <abhinavkdeval08@gmail.com>

@colinjlacy colinjlacy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@colinjlacy
colinjlacy merged commit 9fd877a into runtimeconditions:main Dec 2, 2026
2 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.

Replace bespoke JSON schema types with existing types library

2 participants