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 fixfalseto mean a closed object and add tests. - Assistant
Implementing the fix: treat boolean
additionalProperties: falseas a closed object instead of map-like. - Assistant
Fixed the v4 OpenAPI schema importer so
additionalProperties: falseis treated as a closed object instead of a free-form map.Problem
In
schemas.rs, any presence ofadditionalPropertiestriggered map import by recursively callingimport_schemaon the value. ForadditionalProperties: false, that passed a boolean into schema import, which fell through to aMap { value_type_ref: "json" }shape.Fix
The object branch now matches on the
additionalPropertiesvalue:false→IrTypeShape::Object { fields: vec![] }(closed object)true→IrTypeShape::Map { value_type_ref: "json" }(free-form map)- schema object → existing map behavior with typed values
Objects with both
propertiesandadditionalProperties: falsewere already handled correctly via the properties branch; the fix targets the no-properties case.Tests
Added
importer_respects_additional_properties_during_schema_importcovering:- alone → empty closed object
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.