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 there's a related "projection" concept that also builds inputs required from parameters, to ensure consistency (the issue mentions "projection coverage").
Assistant
Let's view the whole test file to understand how to add a new test that checks operation inputs.
Assistant
Now let's add a new test using this pattern to verify path parameter without
requiredfield is treated as required, and query parameter withoutrequiredstays optional.Assistant
Now let's check projection_tests.rs for similar coverage related to required inputs and SQL filters exposure.
Assistant
Now let's add a focused projection test with omitted
requiredfor a path parameter.Assistant
Now let's add a projection test that omits
requiredon a path parameter and verifies the projection input is required and exposed as a filter/table function.Assistant
Now let's check imports in projection_tests.rs to make sure ProjectionKind is imported.
Assistant
use super::*;should bring in ProjectionKind if it's re-exported at module level. Let's check the mod.rs of v4 for pub use.Assistant
Good, ProjectionKind is exported. Now let's build/run tests.
Assistant
All openapi_tests pass. Now let's run projection_tests.
Assistant
All pass. Now let's run the full test suite for coral-spec crate to be thorough, and also check other crates that might reference this behavior (e.g., manifest_tests, cli e2e tests referencing sources).
Assistant
All 222 tests pass. Let's also run the broader workspace test suite that touches this, especially coral-cli and coral-app, to verify no regressions from real-world source manifests (e.g., core-v4 sources).
Assistant
Build succeeds across the whole workspace. Now let's check for real openapi source specs (github_v4, stripe_v4) to see if any path parameters lack
requiredfield, which would change behavior.Assistant
These reference external OpenAPI specs (fetched at import time), not stored in repo, so nothing more to check there. Let's view the diff summary.
Assistant
This is a clean, minimal fix. Let's run clippy to ensure no lints break (repo may enforce clippy in CI).
Assistant
Clippy passes with no warnings. Let's also double check formatting (rustfmt) consistency.
Assistant
Formatting is clean. Let's view final diff for full review.
Assistant
The diff is clean and minimal. Now let's go through the checklist.
Assistant
Let me verify the tests actually fail without the fix (to confirm proper reproduction), then restore the fix.
Assistant
Confirmed the tests fail without the fix, reproducing the issue. Now restore the fix.
Assistant
The fix is restored and all 222 tests pass, including the two new focused tests confirming the fix works correctly.
Let me review the checklist:
Assistant
Everything builds and passes cleanly.
Checklist Review
-
[x] If an error was reported in the issue description, I have successfully reproduced it. — The issue describes a misclassification (not a crash/error): OpenAPI path parameters imported as optional when is omitted. I reproduced this by writing two tests ( in and in ), then verified via that they fail against the original code (path param was , and the projection was generated as a plain instead of , matching the exact misclassification described in the issue).
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.