Skip to content

fix(js/core): allow Gemini propertyOrdering in schema validation - #5865

Open
a2105z wants to merge 1 commit into
genkit-ai:mainfrom
a2105z:fix/js-property-ordering-schema
Open

fix(js/core): allow Gemini propertyOrdering in schema validation#5865
a2105z wants to merge 1 commit into
genkit-ai:mainfrom
a2105z:fix/js-property-ordering-schema

Conversation

@a2105z

@a2105z a2105z commented Jul 30, 2026

Copy link
Copy Markdown

Summary

  • Register Gemini's non-standard propertyOrdering JSON Schema keyword with Ajv so structured-output schemas that include it no longer fail with strict mode: unknown keyword.
  • Add unit coverage for compile and interpret validation modes, including a case that still rejects invalid data when propertyOrdering is present.

Fixes #3764

Test plan

  • npm test in js/core (179 tests passing)
  • Reproduce the original ai.generate + output.jsonSchema.propertyOrdering case and confirm it no longer throws

Register the non-standard propertyOrdering keyword with Ajv so structured
output schemas that include Gemini field-order hints no longer fail to compile.

@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 registers the non-standard propertyOrdering keyword in Ajv to prevent strict mode validation errors when processing Gemini structured output schemas. It also adds corresponding unit tests to verify that schemas containing propertyOrdering are correctly validated in both standard and interpret modes. I have no feedback to provide.

@a2105z

a2105z commented Jul 30, 2026

Copy link
Copy Markdown
Author

Hi @pavelgj @ssbushi — whenever you have a moment, could you take a look at this small js/core schema fix and approve the pending fork workflows if needed?

It registers Gemini's non-standard propertyOrdering keyword with Ajv so structured-output schemas no longer fail strict validation (Fixes #3764). Thanks!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[JS] Support propertyOrdering in structured output

1 participant