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.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
I’ll inspect the repository to locate the OpenAPI v4 importer, its parameter-requiredness logic, and relevant tests. I’ll then reproduce the omission case, make the smallest source change, run focused and broader affected tests, and review the diff before submission.
- Assistant
The v4 implementation is under
crates/coral-spec/src/v4/surfaces/openapi, with importer tests inopenapi_tests.rsand projection tests inprojection_tests.rs. I’ll inspect how parameter location andrequiredare converted, plus the existing assertions, to distinguish path behavior from query/header behavior. - Assistant
The bug is exactly in
import_parameters: all locations currently defaultrequiredtofalse. The IR enum supports matchingPath, and downstream projection generation uses this flag for table-function arguments, filter nullability, and request classification. I’ll make path parameters unconditionally required while leaving the existing boolean/default behavior unchanged for query, header, cookie, and body parameters. - Assistant
The source change is in place and
git diff --checkis clean. I’ll now run formatting and the completecoral-spectest suite, which covers both importer and projection behavior; then I’ll inspect the final diff and status. - Assistant
Formatting and all 219
coral-speclibrary tests pass. The implementation preserves explicitrequired: true/falsesemantics for non-path locations and overrides omission (and invalid false values) only forin: path, matching OpenAPI’s rule that path parameters are required. I’ll run the package-wide tests once more (including non-library targets) and perform the final repository check 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.