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.
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-$
- Assistant
I’ll first map the repository and locate the DSL v4 OpenAPI importer, its requiredness logic, and relevant tests. Then I’ll reproduce the omitted-
requiredpath-parameter behavior, implement the narrow fix while preserving non-path semantics, and run focused plus broader tests. - Assistant
rgis unavailable, so I’ll usefind/grep. I’ll also read the repository’s agent guidance before editing and identify likely importer files by names and textual references. - Assistant
The requiredness is most likely assigned in
operations.rs, while projection classification consumes it inderive.rs. I’ll inspect those implementations and the focused test structure to understand exact IR/projection assertions and avoid changing unrelated behavior. - Assistant
The defect is confirmed in source: every parameter uses
required.unwrap_or(false)without considering location. OpenAPI 3.0 requires path parameters to haverequired: true; importer normalization should therefore set path inputs true even for malformed/omitted or explicit-false documents, while retaining the declared/default-false behavior elsewhere. Before editing, I’ll inspect projection argument derivation and fixtures for an existing omitted path field that can serve as a behavioral reproduction without changing repository tests. - Assistant
No existing fixture omits path requiredness, so I’ll reproduce through a temporary external Cargo binary (outside the repository and not a test) using the public importer/projection APIs. It will include: a path parameter with omitted
required, a query parameter with omittedrequired, and a query parameter with explicitrequired: true; this simultaneously establishes the bug and the non-path baseline. - Assistant
The temporary binary compiled the crate but used the wrong module path; v4 APIs are exposed under
coral_spec::v4. I’ll correct only that external repro and rerun it. - Assistant
The v4 manifest schema rejects legacy
versionfields, so I’ll remove those from the temporary input and rerun. - Assistant
The repro shows the exact misclassification in both IR and projection, while non-path defaults/explicit behavior are correct. I’ll make the narrow normalization at import time:
Pathalways wins, otherwise preserve the existing boolean/default-false handling. Because projection bindings are derived from the IR, this fixes both layers consistently. I’ll also inspect importer-version usage before deciding whether this behavioral importer change requires a version bump. - Assistant
Importer versions are compatibility gates for materialized semantic IR, so changing import semantics without a bump could allow stale v2 artifacts to retain the bug indefinitely. I’ll inspect the version-validation behavior and git history around prior bumps to follow the project’s convention rather than guessing.
- Assistant
The compatibility gate exists, but this preview v4 importer has no established bump history and the acceptance scope is the requiredness normalization itself; bumping would invalidate every existing v4 materialization, a disproportionate migration effect not requested here. I’ll keep the importer version stable and verify the fix with the same public-API repro. Then I’ll extend the temporary repro to cover explicit
falseon a path (still required by OpenAPI) and explicitfalseon a query (preserved). - Assistant
The fixed repro now confirms both importer and projection behavior: omitted and explicit-false path parameters become required, while omitted/false/true query declarations remain false/false/true. I’ll format and run the full
coral-spectest suite, which covers the importer/projection modules most directly, then inspect lint/diff. - Assistant
Formatting and all 219
coral-specunit tests plus doctests pass. The repository guidance requiresmake rust-checksfor Rust changes, so I’ll inspect the target and run it; afterward I’ll ensure no generated/unintended files changed and review the final diff. - Assistant
make rust-checkspassed formatting and workspace-wide Clippy with warnings denied, then stopped only because the environment lacks thecargo-nextestsubcommand—not because of code. Since dependencies are now built, I’ll use standard Cargo to run the equivalent workspace test selection, followed by the documentation check if tests pass. - Assistant
The standard workspace suite passed the affected crate and all 185
coral-appunit tests, but two unrelated gRPC filesystem-permission tests failed because this environment runs as root, so chmod-based “write/cleanup should fail” assumptions do not hold. The failures are outside OpenAPI logic and occurred after 59 other gRPC tests passed. I’ll complete the rustdoc gate, then inspect repository state and the exact final patch.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- xiaomi/mimo-v2.5-proCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →