ISSUE DESCRIPTION Treat OpenAPI path parameters as required in v4 import This tracks…
- User
ISSUE DESCRIPTION
Treat OpenAPI path parameters as required in v4 import This tracks unresolved feedback identified by cubic on PR #1149: https://github.com/withcoral/coral/pull/1149#discussion_r3347190640
Context: This appears to be pre-existing DSL v4 behavior surfaced by the refactor review, not a regression from the module split.
Problem: OpenAPI path parameters are imported as optional when
requiredis omitted, even though path parameters are required by OpenAPI. This can misclassify required path inputs as optional SQL filters.Acceptance criteria: Import path parameters as required regardless of an omitted
requiredfield, preserve explicit behavior for non-path parameters, and add focused importer/projection 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
Let me search for the OpenAPI importer code:
Assistant
I understand the issue. Let me look at the related files:
Assistant
Now let me look at the IR types:
Assistant
Now let me look at the projection logic to understand the impact:
Assistant
Let me look at the projections/derive.rs file:
Assistant
Now let me understand the structure better. Let me look at how tests are organized:
Assistant
Now let me make the fix. I need to understand the issue more:
Assistant
Let me check for any existing tests with
required: falsefor path parameters to make sure I don't break them:Assistant
All test cases that have
in: pathalso explicitly setrequired: true. Let me look at the PR referenced for more context:Assistant
Now I understand. Let me make the fix. The fix needs to set
required: truefor path parameters regardless of whetherrequiredis set:Assistant
Now let me apply the fix. Per the OpenAPI spec, path parameters are required by definition. Let me make the fix:
Assistant
me use the replace tool instead:
Assistant
Now I need to verify that
OpenApiParameterLocationis in scope. Let me check the imports:Assistant
Good,
OpenApiParameterLocationis already imported. Let me verify it builds:Assistant
Build succeeded. Now let me run the existing tests to make sure I haven't broken anything:
Assistant
All existing tests pass. Now let me write a temporary test script to verify the fix works:
Assistant
Good. Let me set up a temporary integration test that we can use to verify our fix. Let me create an integration test in a temporary directory:
Assistant
Test 1 passes. Now let me run all the tests:
Assistant
All tests pass. Now let me also check that the test reflects the projection-level behavior, especially for the "required path inputs" being misclassified as optional SQL filters scenario:
Assistant
- so for a singleton with required inputs, the projection becomes
TableFunctionand the path parameters becomeFunctionArg. Let me update the test:
- so for a singleton with required inputs, the projection becomes
Assistant
All tests pass. The fix works correctly. Let me clean up the temporary files and run all the relevant tests to make sure nothing is broken:
Assistant
Now let me run the full coral-spec tests:
Assistant
All 219 tests pass. Let me also run any tests in coral-app that might use this code:
Assistant
No failures. Let me also check the integration tests:
Assistant
These failures are unrelated to my changes - they're in
source_lifecycle_testsrelated to manifest cleanup. Let me verify by checking the git status and ensure my changes are isolated:Assistant
Good - only my change to operations.rs is staged. Let me verify that the failing tests are pre-existing failures not caused by my change:
Assistant
These tests are failing even without my change - they're pre-existing failures unrelated to the OpenAPI path parameter fix. Let me restore my changes:
Assistant
Let me verify all tests are still passing:
Assistant
All 23 v4 tests pass. Let me also run the full coral-spec tests one more time:
Assistant
All 219 tests pass. Let me also run clippy to check for any issues:
Assistant
No clippy warnings. Let me also run rustfmt check:
Assistant
Format check passes too. Let me check the final state of my changes:
Assistant
The change is minimal and focused. Let me now review the checklist:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.