Skip to content

fix(web_core): enforce minProperties, maxProperties and typeless not in JSON schemas - #4057

Open
Anoshor wants to merge 11 commits into
a2ui-project:mainfrom
Anoshor:fix/schema-loader-property-counts-and-typeless-not
Open

Anoshor wants to merge 11 commits into
a2ui-project:mainfrom
Anoshor:fix/schema-loader-property-counts-and-typeless-not

Conversation

@Anoshor

@Anoshor Anoshor commented Nov 8, 2026

Copy link
Copy Markdown

Description

Rows 1, 2 and 6 of #3998. These are the gaps in the table that are self-contained and don't depend on which of the two options in the issue is chosen; row 6 is the one the issue says could be split out and fixed sooner, because it refuses a valid value.

  • Rows 1 and 2: minProperties and maxProperties weren't translated. They now apply to an arguments object (including constraints on allOf pieces) and to an object property. Keys are counted on the value as written, before the object schema fills in defaults or drops undeclared keys, with the same z.preprocess pattern finalizePropertyZod uses for not.
  • Row 6: a schema with no type became z.unknown(), so not: {required: ['b']} matched every value and rejected everything. A typeless schema that declares object keywords (properties, patternProperties, required, minProperties, maxProperties) is now converted so it checks the objects it matches and accepts every other value, as JSON Schema does. A typeless schema with none of those keywords is still z.unknown(). required is checked directly in the new helper: an object with required but no properties is still converted to an opaque record by the existing object case, which I left unchanged.

Rows 3 to 5 (top-level oneOf, anyOf and not) are not touched; they depend on the choice between patching the converter and validating with a JSON Schema validator.

Verification:

  • Two new tests in agent_functions.test.ts (PayloadValidator with AgentFunction) cover rows 1, 2 and 6, plus a maxProperties on a nested property and the non-object cases for a typeless not. Both fail on main and pass here.
  • yarn test in typescript/core/web_core: 1536 passed, 0 failed (includes the conformance suites). eslint reports no new warnings; prettier --check is clean.

Part of #3998

Pre-launch Checklist

One time:

For this PR:

  • I have updated the relevant CHANGELOG.md file.
  • I updated/added relevant documentation.
  • My code changes (if any) have tests.
  • If my branch is on a fork, I have verified that scripts/e2e_test.sh passes.

…in JSON schemas

The JSON Schema to Zod converter ignored `minProperties` and
`maxProperties`, and converted a schema with no `type` to `z.unknown()`.
The second turns `not: {required: [...]}` into "reject every value", so a
valid value is refused.

Apply both bounds to arguments objects and to object properties, counting
keys on the value as written. Convert a typeless schema that declares object
keywords so it checks the objects it matches and accepts every other value,
as JSON Schema does.

Rows 1, 2 and 6 of a2ui-project#3998. The top-level `oneOf`, `anyOf` and `not` gaps are
left for the approach the issue asks maintainers to choose.

Part of a2ui-project#3998

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for enforcing minProperties and maxProperties constraints on JSON schemas, and properly handles typeless subschemas that declare object keywords within not schemas. The feedback suggests ensuring that minProperties and maxProperties are validated as non-negative integers to fully align with the JSON Schema specification.

Comment on lines +203 to +204
const min = typeof raw.minProperties === 'number' ? raw.minProperties : undefined;
const max = typeof raw.maxProperties === 'number' ? raw.maxProperties : undefined;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To align with the JSON Schema specification and ensure robust validation, minProperties and maxProperties should be validated as non-negative integers. This prevents negative values or floating-point numbers from causing unexpected validation behavior.

  const min =
    typeof raw.minProperties === 'number' &&
    Number.isInteger(raw.minProperties) &&
    raw.minProperties >= 0
      ? raw.minProperties
      : undefined;
  const max =
    typeof raw.maxProperties === 'number' &&
    Number.isInteger(raw.maxProperties) &&
    raw.maxProperties >= 0
      ? raw.maxProperties
      : undefined;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Applied in 41b4558, with a test that a negative or fractional bound is ignored. Thanks.

@github-actions github-actions Bot added the status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs label Nov 8, 2026
…-not

# Conflicts:
#	typescript/core/web_core/CHANGELOG.md
@Anoshor

Anoshor commented Nov 12, 2026

Copy link
Copy Markdown
Author

Hi @nan-yu, this covers rows 1, 2 and 6 of #3998 (minProperties, maxProperties, and a typeless not), the self-contained ones, and leaves rows 3 to 5 for whichever approach you pick. It follows option 1, so it would be replaced if you go with a JSON Schema validator; could you confirm option 1 first? It's up to date with main and mergeable.

…-not

# Conflicts:
#	typescript/core/web_core/CHANGELOG.md
#	typescript/core/web_core/src/catalog/schema_loader.ts
@polina-c

polina-c commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

From triage bot, analysis:

For humans

TL;DR
Case: this external PR fixes part of a P2 bug, and a later external PR fixes all of it.
Suggestion: assign gspencergoog to review it together with #4285 and pick one.

Summary:
The PR makes the JSON Schema to Zod converter in @a2ui/web_core enforce minProperties and maxProperties, and stops a not over a typeless object schema from rejecting every value. It covers rows 1, 2 and 6 of #3998 and does not close it.

Targeted issues:
#3998

Why flagged for triage:
This external PR has no assignee.

Suggestion:
Assign gspencergoog to review this PR together with #4285 and decide which one lands. #4285 by roblevintennis, opened on 2026-11-18, closes #3998: it covers the same rows, rows 3 to 5 and more keywords such as dependentRequired and if/then/else, in about 1,500 lines. Varun-S10 checked it and escalated it to gspencergoog on 2026-11-20. The two PRs conflict in schema_loader.ts, so only one can land as is. This PR came first (2026-11-08) and is smaller (165 added lines, with tests that the author reports fail on main), so #4285 could rebase on it. If the team takes #4285 instead, close this PR and thank the author. gspencergoog wrote 7 of the 15 commits to schema_loader.ts, including #4187, which patched the same converter for other keywords. The author also asked nan-yu, who filed #3998, to confirm option 1 of the issue (patch the converter keyword by keyword) before a review. Nobody has answered. Both PRs and #4187 follow option 1, so nan-yu or gspencergoog should answer it for both PRs. This PR merges cleanly with main, and its CI runs wait for maintainer approval.

  1. Add labels: component: core sdk, type: bug
  2. Assign: gspencergoog
  3. Related items: fix(web_core): enforce JSON Schema Draft 2020-12 keywords in Zod conversion (#3998) #4285, fix(core): enforce function catalog validation across TypeScript, Dart, Python, and Swift (#4173) #4187

To adjust the analysis and apply its suggestion, run in your a2ui checkout:

tools/internal/triage/triage_ui.sh https://github.com/a2ui-project/a2ui/pull/4057
For software
<a2ui>
root = TriageAnalysis(
  tldr="""Case: this external PR fixes part of a P2 bug, and a later external PR fixes all of it.
Suggestion: assign `gspencergoog` to review it together with #4285 and pick one.""",
  summary="""The PR makes the JSON Schema to Zod converter in `@a2ui/web_core` enforce `minProperties` and `maxProperties`, and stops a `not` over a typeless object schema from rejecting every value. It covers rows 1, 2 and 6 of #3998 and does not close it.""",
  reason="""This external PR has no assignee.""",
  suggestion="""Assign `gspencergoog` to review this PR together with #4285 and decide which one lands. #4285 by `roblevintennis`, opened on 2026-11-18, closes #3998: it covers the same rows, rows 3 to 5 and more keywords such as `dependentRequired` and `if`/`then`/`else`, in about 1,500 lines. `Varun-S10` checked it and [escalated it](https://github.com/a2ui-project/a2ui/pull/4285#issuecomment-7030754723) to `gspencergoog` on 2026-11-20. The two PRs conflict in `schema_loader.ts`, so only one can land as is. This PR came first (2026-11-08) and is smaller (165 added lines, with tests that the author reports fail on `main`), so #4285 could rebase on it. If the team takes #4285 instead, close this PR and thank the author. `gspencergoog` wrote [7 of the 15 commits](https://github.com/a2ui-project/a2ui/commits/main/typescript/core/web_core/src/catalog/schema_loader.ts) to `schema_loader.ts`, including #4187, which patched the same converter for other keywords. The author also [asked](https://github.com/a2ui-project/a2ui/pull/4057#issuecomment-6833007146) `nan-yu`, who filed #3998, to confirm option 1 of the issue (patch the converter keyword by keyword) before a review. Nobody has answered. Both PRs and #4187 follow option 1, so `nan-yu` or `gspencergoog` should answer it for both PRs. This PR merges cleanly with `main`, and its CI runs wait for maintainer approval.""",
  added_labels=["component: core sdk", "type: bug"],
  new_assignees=["gspencergoog"],
  targeted_issues=[3998],
  related_items=[4285, 4187]
)
</a2ui>

This analysis is auto-created to help humans to triage this item. Please, do not treat it as a team decision.

🤖 Agent-generated

@polina-c

Copy link
Copy Markdown
Collaborator

Thanks for the PR and for splitting out the self-contained rows. #4285 also fixes these rows of #3998, along with rows 3 to 5, and the two PRs conflict. The team will decide which PR to take, and whether to keep patching the converter (option 1 in #3998), and will come back to you here.

@polina-c polina-c added component: core sdk Affects the core SDK layer in any language status: assigned-for-triage issue/pr is assigned to a domain expert for further triage type: bug Something isn't working and removed status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs labels Nov 20, 2026
…-not

# Conflicts:
#	typescript/core/web_core/CHANGELOG.md
…-not

# Conflicts:
#	typescript/core/web_core/CHANGELOG.md

@gspencergoog gspencergoog left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This change adds minProperties and maxProperties validation to JSON Schema objects loaded by schema_loader.ts (for Catalog.fromJson properties and AgentFunction arguments) via withPropertyCountBounds, and adds convertTypelessToZod so schemas without type that declare object keywords validate objects while letting non-objects pass.

The core withPropertyCountBounds and convertTypelessToZod helpers handle zero bounds, invalid bounds, non-object pass-through, and ZodEffects key extraction cleanly, and the prior gemini-code-assist thread requesting non-negative integer bound checks is addressed at HEAD. However, allOf and $ref argument subschemas that declare only minProperties or maxProperties are dropped in collectArgSubSchemas, allOf-composed properties bypass withPropertyCountBounds, convertTypelessToZod and convertPropertyToZod drop additionalProperties: false and unevaluatedProperties: false when properties and patternProperties are absent, CHANGELOG.md misplaces and mislabels a validation-tightening entry, and key test invariants lack coverage.

🤖 Agent-generated

);
}
}
for (const piece of new Set(allSchemas)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

allSchemas omits any allOf branch or $ref target that declares only minProperties or maxProperties because collectArgSubSchemas does not check those keywords. Function argument schemas composing property-count bounds via allOf or $ref silently accept payloads that violate those bounds.

--- a/typescript/core/web_core/src/catalog/schema_loader.ts
+++ b/typescript/core/web_core/src/catalog/schema_loader.ts
@@ -1185,7 +1185,9 @@ function collectArgSubSchemas(
     requiredDisjunction ||
     schema.patternProperties ||
     schema.additionalProperties !== undefined ||
-    schema.unevaluatedProperties !== undefined
+    schema.unevaluatedProperties !== undefined ||
+    schema.minProperties !== undefined ||
+    schema.maxProperties !== undefined
   ) {
     result.schemas.push(schema);
   }
Details

Impact: Function argument schemas composing property-count bounds via allOf or $ref silently accept payloads that violate those bounds.

Evidence (Deduction): schema_loader.ts:1235 collects subschemas via collectArgSubSchemas; schema_loader.ts:1182-1191 only pushes schema when properties, required, requiredDisjunction, patternProperties, additionalProperties, or unevaluatedProperties is present; schema_loader.ts:1267 builds allSchemas from [rawSchema, ...collected.schemas], so schema_loader.ts:1287-1289 skips bounds-only branches.

For example, {allOf: [{type: 'object', properties: {a: {type: 'string'}}}, {minProperties: 1}]} or {$ref: '#/$defs/Bounded'} where Bounded is {type: 'object', maxProperties: 1} resolves cleanly in collectArgSubSchemas, fails the guard at schema_loader.ts:1182-1189, and never reaches withPropertyCountBounds at schema_loader.ts:1288. Adding schema.minProperties !== undefined || schema.maxProperties !== undefined to collectArgSubSchemas is safe for all existing loops over collected.schemas and allSchemas, because each loop guards on its own keyword.

🤖 Agent-generated

}

/** Keywords that constrain an object even when the schema declares no `type`. */
const TYPELESS_OBJECT_KEYWORDS = [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

TYPELESS_OBJECT_KEYWORDS omits additionalProperties and unevaluatedProperties, and convertPropertyToZod's object branch falls back to z.record(z.unknown()) whenever properties and patternProperties are absent. {not: {additionalProperties: false}} rejects every input, and {required: ['b'], additionalProperties: false} silently accepts disallowed keys.

--- a/typescript/core/web_core/src/catalog/schema_loader.ts
+++ b/typescript/core/web_core/src/catalog/schema_loader.ts
@@ -235,6 +235,8 @@ const TYPELESS_OBJECT_KEYWORDS = [
   'required',
   'minProperties',
   'maxProperties',
+  'additionalProperties',
+  'unevaluatedProperties',
 ];
@@ -657,6 +659,8 @@ function convertPropertyToZod(
       const hasPatterns =
         typeof propSchema.patternProperties === 'object' && propSchema.patternProperties !== null;
+      const forbidExtra =
+        propSchema.additionalProperties === false || propSchema.unevaluatedProperties === false;
       let obj: z.ZodTypeAny;
-      if ((typeof props === 'object' && props !== null) || hasPatterns) {
+      if ((typeof props === 'object' && props !== null) || hasPatterns || forbidExtra) {
@@ -673,8 +677,6 @@ function convertPropertyToZod(
             visitedPointers,
             defCache,
           ),
         );
-        const forbidExtra =
-          propSchema.additionalProperties === false || propSchema.unevaluatedProperties === false;
         obj = closeObjectSchema(
Details

Impact: {not: {additionalProperties: false}} rejects every input, and {required: ['b'], additionalProperties: false} silently accepts disallowed keys.

Evidence (Deduction): schema_loader.ts:232-238 omits additionalProperties and unevaluatedProperties from TYPELESS_OBJECT_KEYWORDS, so schema_loader.ts:259-260 returns z.unknown(); when paired with required or bounds without properties, schema_loader.ts:273-278 calls convertPropertyToZod({...keywords, type: 'object'}), which hits schema_loader.ts:685 (obj = z.record(z.unknown())).

When propSchema is {additionalProperties: false} inside not, convertTypelessToZod returns z.unknown(), which matches {a: 1} as well as {} and causes not to reject every object. Even when combined with a listed keyword such as {required: ['b'], additionalProperties: false}, stripping required leaves {additionalProperties: false, type: 'object'}, which bypasses closeObjectSchema because props and hasPatterns are both absent. Routing forbidExtra through closeObjectSchema with an empty props map produces z.object({}).strict(), rejecting non-empty objects while preserving non-object pass-through in convertTypelessToZod.

🤖 Agent-generated

}
return finalizePropertyZod(obj, propSchema, rootDoc, visitedPointers, defCache);
return finalizePropertyZod(
withPropertyCountBounds(obj, propSchema),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

withPropertyCountBounds is wired only into case 'object' and convertFunctionArgsJsonSchemaToZod, skipping convertAllOfPropertyToZod and collectComponentSubSchemas. Component or nested properties composed with allOf silently ignore minProperties and maxProperties declared on either the outer schema or any branch.

--- a/typescript/core/web_core/src/catalog/schema_loader.ts
+++ b/typescript/core/web_core/src/catalog/schema_loader.ts
@@ -481,13 +481,17 @@ function convertAllOfPropertyToZod(
             s.kind === 'json' &&
             (s.schema.additionalProperties === false || s.schema.unevaluatedProperties === false),
         );
-      const obj = closeObjectSchema(
+      const jsonPieces = [
+        propSchema,
+        ...subSchemas.flatMap(s =>
+          s.kind === 'json' && s.schema !== propSchema ? [s.schema] : [],
+        ),
+      ];
+      let obj = closeObjectSchema(
         baseObj,
-        [
-          propSchema,
-          ...subSchemas.flatMap(s =>
-            s.kind === 'json' && s.schema !== propSchema ? [s.schema] : [],
-          ),
-        ],
+        jsonPieces,
         forbidExtra,
         rootDoc,
         visitedPointers,
         defCache,
       );
+      for (const piece of new Set(jsonPieces)) {
+        obj = withPropertyCountBounds(obj, piece);
+      }
       return finalizePropertyZod(obj, propSchema, rootDoc, visitedPointers, defCache);
     }
   }
@@ -505,7 +509,13 @@ function convertAllOfPropertyToZod(
   for (let i = 1; i < zodBranches.length; i++) {
     intersected = intersected.and(zodBranches[i]);
   }
-  return finalizePropertyZod(intersected, propSchema, rootDoc, visitedPointers, defCache);
+  return finalizePropertyZod(
+    withPropertyCountBounds(intersected, propSchema),
+    propSchema,
+    rootDoc,
+    visitedPointers,
+    defCache,
+  );
 }
Details

Impact: Component or nested properties composed with allOf silently ignore minProperties and maxProperties declared on either the outer schema or any branch.

Evidence (Deduction): schema_loader.ts:556-559 dispatches allOf properties to convertAllOfPropertyToZod before case 'object' (schema_loader.ts:688); schema_loader.ts:484-497 flattens subSchemas into z.object(shape) and calls finalizePropertyZod(obj, ...) without withPropertyCountBounds, and schema_loader.ts:508 also omits withPropertyCountBounds on propSchema.

Catalog.fromJson and AgentFunction always pass rootDoc. An allOf property like {allOf: [{$ref: '#/$defs/NonEmpty'}, {properties: {b: {type: 'string'}}}]} enters the flattening path at schema_loader.ts:438-498. That path drops minProperties and maxProperties on both #/$defs/NonEmpty and the outer schema. Also, collectComponentSubSchemas (schema_loader.ts:1010) only keeps fragments that declare properties, so it drops bounds-only allOf branches too.

🤖 Agent-generated

Comment thread typescript/core/web_core/CHANGELOG.md Outdated
@@ -1,5 +1,6 @@
## Unreleased

- Function arguments and component properties defined in JSON Schema (by `Catalog.fromJson` or an `AgentFunction` `schema`) enforce `minProperties` and `maxProperties`, and a `not` subschema with no `type` that declares object keywords (`required`, `properties`, `patternProperties`, `minProperties`, `maxProperties`) checks the objects it matches instead of matching every value, so a `not` over it no longer rejects everything. Such a subschema accepts non-objects, as in JSON Schema. [#3998](https://github.com/a2ui-project/a2ui/issues/3998), [#4057](https://github.com/a2ui-project/a2ui/pull/4057)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This entry tightens validation rules without a **BREAKING CHANGE**: prefix or migration note and sits above existing **BREAKING CHANGE**: bullets. It also narrows typeless object validation to not subschemas, though all typeless schemas now enforce those keywords. Consumers upgrading may hit unexpected validation rejections on payloads that previously passed, and the entry conflicts with repository changelog ordering rules.

Suggested change
- Function arguments and component properties defined in JSON Schema (by `Catalog.fromJson` or an `AgentFunction` `schema`) enforce `minProperties` and `maxProperties`, and a `not` subschema with no `type` that declares object keywords (`required`, `properties`, `patternProperties`, `minProperties`, `maxProperties`) checks the objects it matches instead of matching every value, so a `not` over it no longer rejects everything. Such a subschema accepts non-objects, as in JSON Schema. [#3998](https://github.com/a2ui-project/a2ui/issues/3998), [#4057](https://github.com/a2ui-project/a2ui/pull/4057)
- **BREAKING CHANGE**: Function arguments and component properties defined in JSON Schema (by `Catalog.fromJson` or an `AgentFunction` `schema`) enforce `minProperties` and `maxProperties`, and any typeless schema that declares object keywords (`required`, `properties`, `patternProperties`, `minProperties`, `maxProperties`) validates object values while accepting non-objects, so a `not` over one no longer rejects every value. Recommended migration: ensure payloads satisfy declared property-count bounds and typeless object constraints. [#3998](https://github.com/a2ui-project/a2ui/issues/3998), [#4057](https://github.com/a2ui-project/a2ui/pull/4057)
Details

Impact: Consumers upgrading may hit unexpected validation rejections on payloads that previously passed, and the entry conflicts with repository changelog ordering rules.

Evidence (Read): "- Function arguments and component properties defined in JSON Schema (by \Catalog.fromJson` or an `AgentFunction` `schema`) enforce `minProperties` and `maxProperties`, and a `not` subschema with no `type` that declares object keywords..." (typescript/core/web_core/CHANGELOG.md:3), placed above three BREAKING CHANGE: bullets (typescript/core/web_core/CHANGELOG.md:4-6); schema_loader.ts:696-702callsconvertTypelessToZodfor all typeless schemas, not onlynotsubschemas;.agents/skills/update-changelog/SKILL.md:60-63requiresBREAKING CHANGE:first for validation-rule changes (matchingCHANGELOG.md:18`).

🤖 Agent-generated

assert.throws(() => validateWith(schema, {o: {a: 'y', b: 'x'}}), isValidationError);
});

it('checks minProperties and maxProperties on an arguments object and on a property', () => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The new tests never exercise minProperties or maxProperties alongside property defaults, so replacing z.preprocess with .superRefine in withPropertyCountBounds would leave the suite green despite violating the documented contract (schema_loader.ts:196-197). They also skip maxProperties: 0, standalone typeless object schemas, the other TYPELESS_OBJECT_KEYWORDS, and Catalog.fromJson component properties. Regressions in pre-default counting, zero-bound truthiness checks, or component property loading would ship undetected.

Details

Impact: Regressions in pre-default counting, zero-bound truthiness checks, or component property loading would ship undetected.

Evidence (Read): agent_functions.test.ts:1041-1080 tests only maxProperties: 1, minProperties: 1, malformed bounds [-1, 1.5], and not: {required: ['b']}, with no defaults on bounded properties, no zero upper bound, no Catalog.fromJson component property, and none of the other four keywords in TYPELESS_OBJECT_KEYWORDS (schema_loader.ts:232-238).

🤖 Agent-generated

…-not

# Conflicts:
#	typescript/core/web_core/CHANGELOG.md
…ess schemas

Mark the changelog entry breaking, name that a schema with no type enforces
its object keywords everywhere, not only under not, and add a migration note.
Add tests for maxProperties 0, bounds counted before defaults fill in, and
standalone typeless object schemas.
@Anoshor

Anoshor commented Dec 3, 2026

Copy link
Copy Markdown
Author

Thanks @gspencergoog, this is a useful review. In 9c86dcc:

  • Changelog: the entry is now marked **BREAKING CHANGE** with a migration note, and it says that any schema with no type that declares object keywords validates objects and accepts other values, not only a not subschema.
  • Tests: added a test that counts the bounds on the payload as written (maxProperties: 0, and a default that fills in a property after the check does not change the count), and one for standalone typeless schemas (required, the two bounds and properties, with non-objects still accepted). I checked that treating a bound of 0 as unset makes the first one fail.

I have not taken the rest, which widens this PR beyond the rows I started from: minProperties/maxProperties reached through allOf and $ref, additionalProperties and unevaluatedProperties on typeless schemas, and wiring the bounds through convertAllOfPropertyToZod. #4285 covers more of #3998, so I'd rather leave those to whichever PR the team picks than grow this one. Happy to take them here if you prefer this one.

web_core passes 1712 tests. The ci-renderers failure is in the Angular templates (validationErrors), which this PR doesn't touch.

@gspencergoog

Copy link
Copy Markdown
Collaborator

@Anoshor Thanks for updating the changelog and adding those tests. Leaving the convertAllOfPropertyToZod and additionalProperties/unevaluatedProperties changes out of this PR works for me.

Two small things before we can merge:

  1. workspace-lint is currently failing on schema_loader.ts lines 201 and 251 (jsdoc/check-tag-names: @returns needs to be @return).
  2. Either include the two-line minProperties !== undefined || maxProperties !== undefined check in collectArgSubSchemas, or remove "(including constraints on allOf pieces)" from the PR description so it matches what is enforced here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: core sdk Affects the core SDK layer in any language status: assigned-for-triage issue/pr is assigned to a domain expert for further triage type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants