Respect additionalProperties false during v4 OpenAPI schema import This tracks…
- User
Respect additionalProperties false during v4 OpenAPI schema import This tracks unresolved feedback identified by cubic on PR #1149: https://github.com/withcoral/coral/pull/1149#discussion_r3347190658
Context: This appears to be pre-existing DSL v4 behavior surfaced by the refactor review, not a regression from the module split.
Problem: The schema importer treats the presence of
additionalPropertiesas map-like, soadditionalProperties: falsecan be imported as a free-form map instead of a closed object.Acceptance criteria: Handle boolean
additionalProperties: falseas a closed object, preserve schema-valued additionalProperties behavior, and add focused schema import coverage.Interface
No new interfaces are introduced.
- Assistant
I'll locate the v4 OpenAPI schema importer and how it handles
additionalProperties, then fix booleanfalseto mean a closed object. - Assistant
Implementing the fix: treat boolean
additionalProperties: falseas a closed object, and keep schema-valuedadditionalPropertiesas maps. - Assistant
Fixed the OpenAPI schema importer so boolean
additionalPropertiesis handled correctly.Problem
In
schemas.rs, any presence ofadditionalPropertiestriggered map import. That meantadditionalProperties: falsewas passed toimport_schemaand ended up asIrTypeShape::Mapinstead of a closed object.Fix
additionalPropertiesis now matched explicitly:false→ closed object (IrTypeShape::Objectwith no fields)true→ open object (IrTypeShape::Json)- schema value → map (
IrTypeShape::Map, unchanged)
Objects with
propertieswere already imported correctly; only the properties-lessadditionalProperties: falsecase was wrong.Tests
Added
importer_treats_additional_properties_false_as_closed_objectcovering:additionalProperties: falsealone → empty closed objectproperties+additionalProperties: false→ object with declared fields- schema-valued
additionalProperties→ map with typed values
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.