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
Now add focused test coverage:
- Assistant
Done. All 221 coral-spec tests pass, clippy is clean, and formatting checks pass.
Summary
Fix (
crates/coral-spec/src/v4/surfaces/openapi/schemas.rs:102): The object branch ofimport_schematreated any presentadditionalPropertiesas map-like, soadditionalProperties: falsewas imported asMapwith a free-form JSON value type — an open map instead of a closed object. The fix checks for the booleanfalsefirst and imports it asIrTypeShape::Object { fields: [] }(a closed object), while schema-valuedadditionalProperties(and booleantrue, which imports as a free-form JSON-valued map) keep the existingMappath.Coverage (
crates/coral-spec/src/v4/openapi_tests.rs), following the crate's existing focused-import test style:importer_treats_additional_properties_false_as_closed_object— assertsadditionalProperties: falseyields anObjectshape with no fields, not aMap.importer_preserves_schema_valued_additional_properties_as_maps— assertsadditionalProperties: {type: string}still imports as a with a string value type, and still imports as a with a value type.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.