Skip to content

fix(validate): resolve $metadata.aliases before oneOf schema validation - #270

Merged
mindsocket merged 1 commit into
mainfrom
fix/250-type-aliases-oneof
Nov 30, 2026
Merged

mindsocket merged 1 commit into
mainfrom
fix/250-type-aliases-oneof

Conversation

@mindsocket

Copy link
Copy Markdown
Owner

Closes #250

Summary

  • Resolves schemaData.type through .aliases (resolveNodeType) in validateNodes (src/validate/index.ts) before checking validTypes, selecting the per-type oneOf validator, and running AJV validation against a non-mutated copy with the canonical type.
  • Keeps the author's original type value in Invalid type "..." diagnostics and on node.schemaData.
  • Added regression test in tests/validate/validate-views.test.ts using knowledge_wiki.json (study -> source alias, verifying both valid and missing-required-field cases, plus genuinely unknown types).

Verification

  • bun test tests/validate/validate-views.test.ts (8 pass, 0 fail)
  • lefthook pre-push (check-plugin-version, pushed-tree full test + hook suites, review-check)

@claude

claude Bot commented Nov 30, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@mindsocket
mindsocket merged commit e095fe6 into main Nov 30, 2026
2 checks passed
@mindsocket
mindsocket deleted the fix/250-type-aliases-oneof branch November 30, 2026 12:57
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.

Type aliases in $metadata.aliases fail oneOf schema validation

1 participant