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
Now let's check if
OpenApiParameterLocationderivesPartialEq.Assistant
Good, it derives PartialEq. Now let's build to check for errors.
Assistant
Build succeeds. Now let's look at projections code to see if there's similar required handling for path params that needs update, and check existing tests for openapi importer and projections.
Assistant
These already use
input.requiredcorrectly. The projections rely on the IR'srequiredfield, which we've fixed at the source. Now let's check the openapi_tests.rs and projection_tests.rs files for existing coverage and add focused tests.Assistant
Now let's add a test after this one for path param required omitted behavior. Let's check the end of the file.
Assistant
Now let's append a new test that checks path parameters are required even without explicit
required: true, and query parameter without required stays optional.Assistant
Now let's check projection_tests.rs for coverage regarding this required flag propagation, per acceptance criteria "add focused importer/projection coverage."
Assistant
Now let's append a test to projection_tests.rs.
Assistant
super::*should bring ProjectionKind, SqlInputExposure etc viause super::*(mod.rs re-exports). Let's check.Assistant
Good, all needed types are exposed. Now add the test.
Assistant
Good, that's fixed now. Let's run the tests.
Assistant
All tests pass. Now let's run the full test suite for coral-spec to be safe, and also check other crates that might use these importer's required field (e.g., cli tests, source materialization).
Assistant
All 222 tests pass. Let's also check the workspace-wide build/tests for other crates depending on coral-spec (like coral-cli, coral-app) to ensure no regressions from this behavior change.
Assistant
Build succeeds across the workspace. Let's run the CLI e2e tests since they involve OpenAPI import too, to check for regressions.
Assistant
No such raw OpenAPI fixture files found. Let's run cargo test for coral-cli and coral-app to be safe.
Assistant
All good. Let's also check the
coral-appcrate tests since it was mentioned in the grep results.Assistant
Confirmed these two failures are pre-existing and unrelated to our change (they fail identically without our modifications, likely due to sandbox filesystem permission behavior). Let's view the diff summary before finalizing.
Assistant
The change is complete and focused. Let's run the full coral-spec test suite once more to confirm everything is green.
Assistant
All tests pass. Let's review the final diff before submitting.
Assistant
Formatting applied. Let's re-run tests to ensure nothing broke.
Assistant
All good. Now let's go through the checklist.
Checklist review:
Assistant
-
If an error was reported in the issue description, I have successfully reproduced it. This issue was a behavioral/logic bug, not an exception/crash. I reproduced the incorrect behavior by writing a test (
importer_treats_path_parameters_as_required_when_omitted) that failed prior to the fix (verified via the initial code before editingoperations.rs, since the original logic returned for a path parameter with omitted ), confirming the bug existed as described.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.