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 thefalsecase and add tests. - Assistant
Implementing the fix: treat boolean
additionalProperties: falseas a closed object, and keep schema-valuedadditionalPropertiesas map-like. - Assistant
Fixed the v4 OpenAPI schema importer so
additionalProperties: falseis treated as a closed object instead of a free-form map.Problem: The importer treated any presence of
additionalPropertiesas map-like, soadditionalProperties: falsewas passed toimport_schemaand ended up asIrTypeShape::Map.Fix in
schemas.rs: whenadditionalPropertiesis the booleanfalse, import asIrTypeShape::Object { fields: vec![] }. Schema-valuedadditionalPropertiesstill imports asIrTypeShape::Map.Tests in
openapi_tests.rscover:additionalProperties: falsewith no properties → empty closed objectadditionalProperties: falsewith declared properties → object with those fields (unchanged path)- schema-valued
additionalProperties→ map with the correct value type
All 13 OpenAPI importer tests pass.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.