ISSUE DESCRIPTION Respect additionalProperties false during v4 OpenAPI schema import…
- User
ISSUE DESCRIPTION
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.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Assistant
Let me start by exploring the repository structure to understand what we're working with.
Assistant
Now let me look at the import.rs to understand how this fits in the bigger
Assistant
Let me see the rest of the openapi_tests.rs file to understand the existing test patterns.
Assistant
Now let me look at how this was implemented before the refactor in v4/mod.rs.
Assistant
me look at the IrTypeShape enum and related types.
Assistant
Let me check other places in the codebase that might process
additionalProperties:Assistant
Let me check the current tests for the import_schema function:
Assistant
Now let me create a reproduction script to confirm the bug first:
Assistant
Now let me run the existing tests for the openapi importer to confirm baseline state:
Assistant
Now let me create a quick reproduction test to confirm the bug:
Assistant
Let me add a temporary test directly in the openapi_tests file to verify:
Assistant
I've confirmed the bug. Now let me apply the fix. First, let me re-read the schemas.rs to plan the fix:
Assistant
let me apply the fix to handle
additionalProperties: falsecorrectly:Assistant
Now let me run the reproduction test to confirm the fix:
Assistant
Now let me verify more edge cases with a more comprehensive test:
Assistant
Hmm the cat command didn't overwrite the file because it was run from a different cwd context. Let me run from the correct path
Assistant
All 5 edge case tests pass. Now let me run all existing tests in coral-spec to make sure I didn't break anything:
Assistant
All 219 existing tests pass. Let me also run the integration tests and check for any other test types:
Assistant
All tests pass. Now let me check that no other crate is affected:
Assistant
Let me confirm these failures are unrelated to my change:
Assistant
Let me check what previous similar PRs looked like:
Assistant
see - past PRs add tests to
openapi_tests.rs. Let me re-read the system instructions about tests more carefully:Assistant
system instructions are clear: "UNDER NO CIRCUMSTANCES should you modify existing tests or add new tests to the repository." Let me clean up my temporary test file:
Assistant
Good. Now let me verify the fix is in place and re-run the existing tests:
Assistant
me also create a one-time verification script to confirm the fix works correctly:
Assistant
All 5 edge cases pass. Let me also run the comprehensive coral-spec tests and make sure nothing is broken:
Assistant
Let me also verify by running the wider rust-checks to be safe:
Assistant
All coral-spec tests pass (219/219). The 2 failing tests in coral-app are unrelated (confirmed earlier to fail even without my fix). Let me clean up the verification files:
Assistant
Let me verify my final fix once more:
Assistant
Let me also verify that all related tests still pass:
Assistant
All v4 tests pass (22 passed). Let me also confirm the make rust-checks part is OK for the changed file:
Assistant
There's a formatting issue. Let me fix it:
Assistant
Clippy passes. Let me run all coral-spec tests one more time:
Assistant
All tests pass. Let me also make a final check of the modified file:
Assistant
me do one final summary and verification before submitting:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.