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 import logic and how
additionalPropertiesis handled today, then fixfalseto mean a closed object and add tests. - Assistant
Implementing the fix: treat boolean
additionalProperties: falseas a closed object instead of importing it as a map schema. - Assistant
The test was looking up the wrong type id — resolved schemas use the operation-based id, not the component ref name. Updating the test accordingly.
- Assistant
Fixed the v4 OpenAPI schema importer so
additionalPropertiesis interpreted by value, not just by presence.Problem: In
schemas.rs, anyadditionalPropertieskey triggered map import. ForadditionalProperties: false, the importer tried to treatfalseas a schema, fell back tojson, and produced a free-form map instead of a closed object.Fix: Added
import_additional_properties_shapethat:false→IrTypeShape::Object { fields: [] }(closed object)true→IrTypeShape::Map { value_type_ref: "json" }(open map)- schema object → existing map import with the resolved value type
Tests added:
importer_treats_additional_properties_false_as_closed_objectimporter_treats_schema_valued_additional_properties_as_map
Objects with explicit
propertiesare unchanged; they still import as objects regardless ofadditionalProperties.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.