Skip to content
TheChatArchiveThe Chat Archive
DeepSeekdeepseek/deepseek-v4-pro· deepseekHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION Respect additionalProperties false during v4 OpenAPI schema import…

  1. 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 additionalProperties as map-like, so additionalProperties: false can be imported as a free-form map instead of a closed object.

    Acceptance criteria: Handle boolean additionalProperties: false as a closed object, preserve schema-valued additionalProperties behavior, and add focused schema import coverage.

    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 using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to 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.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /coral, current file: none) bash-$

  2. DeepSeek Assistant

    Let me start by understanding the repository structure and the issue. The issue is about handling additionalProperties: false during OpenAPI v4 schema import. The problem is that the schema importer treats the presence of additionalProperties as map-like, so additionalProperties: false can be imported as a free-form map instead of a closed object.

    Let me explore the repository to understand its structure and find the relevant code.

  3. DeepSeek Assistant

    Let me find the relevant code related to OpenAPI schema import and additionalProperties handling

  4. DeepSeek Assistant

    Let me look at the relevant files. The key one is likely crates/coral-spec/src/v4/surfaces/openapi/schemas.rs.

  5. DeepSeek Assistant

    I need to use the special commands through the bash terminal. Let me try again.

  6. DeepSeek Assistant

    Let me see the rest of the file

  7. DeepSeek Assistant

    Let me see the rest of the file and look for helper functions

  8. DeepSeek Assistant

    Now I understand the issue. Let me check the IrTypeShape enum to understand available shapes:

  9. DeepSeek Assistant

    Let me look at the IrTypeShape definition.

  10. DeepSeek Assistant

    Let me see the full IrTypeShape enum definition.

  11. DeepSeek Assistant

    Let me now look at the existing tests to understand what test patterns are used.

  12. DeepSeek Assistant

    Let me search for any existing tests related to additionalProperties or map-like

  13. DeepSeek Assistant

    Let me look at the test patterns more closely to understand the structure

  14. DeepSeek Assistant

    Let me search for more related tests and see if there are any tests for Map shapes

  15. DeepSeek Assistant

    Now I have a clear understanding of the issue. Let me look at the line more closely and implement the fix. The issue is on line 102: the code checks if let Some(additional) = resolved.get("additionalProperties") which matches any value (including false). We need to change this to only match when additionalProperties is not false.

    Let me also check if there are any tests related to this module

  16. DeepSeek Assistant

    Now I understand the issue completely. Let me implement the fix:

  17. DeepSeek Assistant

    That edited the wrong file! I need to specify the file. Let me first revert the test file and then edit the correct

  18. DeepSeek Assistant

    Now let me edit the correct file. Let me open the schemas file first and verify the current content:

  19. DeepSeek Assistant

    Now let me edit line 102 to add the condition that skips additionalProperties: false

  20. DeepSeek Assistant

    I see there's a missing { at the end of line 103. Let me fix the syntax:

  21. DeepSeek Assistant

    Let me verify the code compiles by building:

  22. DeepSeek Assistant

    The code compiles. Now let me run the existing tests to make sure nothing is broken:

  23. DeepSeek Assistant

    All tests pass. Let me now verify the fix works correctly by creating a quick reproduction script. Let me also look at the mentioned PR for context:

  24. DeepSeek Assistant

    Let me look at the existing test for schema import - specifically the one that tests importer_handles_recursive_schema_refs to understand the pattern:

  25. DeepSeek Assistant

    Let me look at some test patterns:

  26. DeepSeek Assistant

    Let me think about this more carefully. The acceptance criteria says "Handle boolean additionalProperties: false as a closed object." Currently, my fix makes additionalProperties: false fall through to IrTypeShape::Json, but a closed empty object should probably be IrTypeShape::Object { fields: vec![] }. Let me update the fix to handle this properly:

  27. DeepSeek Assistant

    I see there's an extra } on line 125. Let me fix the structure:

  28. DeepSeek Assistant

    Now let me verify it compiles:

  29. DeepSeek Assistant

    Now let me run the tests:

  30. DeepSeek Assistant

    All tests pass. Now let me create a temporary test script to verify the fix handles both cases correctly:

  31. DeepSeek Assistant

    Let me look at how tests import the import_openapi_surface function:

  32. DeepSeek Assistant

    Let me verify the final state of the changed code:

  33. DeepSeek Assistant

    The fix looks correct. Let me trace through all the edge cases to verify:

    1. additionalProperties: false without properties → Object { fields: [] } (closed empty object) ✓
    2. additionalProperties: true without properties → Map (free-form map) ✓
    3. additionalProperties: {type: string} without properties → Map (typed map) ✓
    4. additionalProperties: false with properties → Object { fields: [...] } (first branch, additionalProperties ignored) ✓
    5. No additionalProperties, no properties → Json (unchanged behavior) ✓

    Let me clean up:

  34. DeepSeek Assistant

    Let me verify the final state of the file one more time:

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.