Skip to content

fix: add additionalProperties: false to response schema - #9

Merged
harry-rhesis merged 1 commit into
mainfrom
fix/schema-additional-properties
Aug 25, 2026
Merged

fix: add additionalProperties: false to response schema#9
harry-rhesis merged 1 commit into
mainfrom
fix/schema-additional-properties

Conversation

@harry-rhesis

Copy link
Copy Markdown
Contributor

Summary

  • Added "additionalProperties": false to both object levels (root and item) in SchemaBuilder response schema
  • Required by OpenAI structured outputs when "strict": true — without it the API rejects the schema
  • Refactored root schema from immutable Map.of() to HashMap to support the additional key
  • Added SchemaBuilderTest with 2 tests verifying the property at both levels for single-turn and multi-turn schemas

Test plan

  • All 65 unit tests pass
  • Spotless + PMD lint clean
  • CI passes (unit, integration, lint)

🤖 Generated with Claude Code

…ration

OpenAI structured outputs with strict mode requires every object node
in the JSON schema to declare additionalProperties: false. Without it
the API rejects the schema. Added at both the root and item levels.

Signed-off-by: Harry Cruz <harry@rhesis.ai>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@harry-rhesis
harry-rhesis merged commit d15039a into main Aug 25, 2026
5 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.

1 participant