Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[schema] Add analyzeIsJsonSubSchema function #2394

Merged
merged 2 commits into from
Jul 2, 2024
Merged

[schema] Add analyzeIsJsonSubSchema function #2394

merged 2 commits into from
Jul 2, 2024

Conversation

aomarks
Copy link
Member

@aomarks aomarks commented Jul 2, 2024

Given the JSON Schemas a and b, determine whether a is a sub-schema of b, and if not explain why.

We say that a is a sub-schema of b if every JSON Schema constraint in b is also present in a at an equal or higher strictness. Examples:

  • If b enforces type string OR number, then a must enforce either string, number, or string OR number.
  • If b enforces maxLength 4, then a must enforce maxLength <= 4 .
Copy link

changeset-bot bot commented Jul 2, 2024

🦋 Changeset detected

Latest commit: 9a9cbfe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@google-labs/breadboard-schema Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@aomarks aomarks enabled auto-merge (squash) July 2, 2024 19:49
@aomarks aomarks merged commit dd783e0 into main Jul 2, 2024
10 checks passed
@aomarks aomarks deleted the schema-subset branch July 2, 2024 19:51
aomarks added a commit that referenced this pull request Jul 2, 2024
Uses the new `analyzeIsJsonSubSchema` function from
#2394

Part of #2298
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant