Treat OpenAPI path parameters as required in v4 import This tracks unresolved feedback…
- User
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.
- Assistant
Now let me find existing importer tests to see where coverage lives.
- Assistant
Now I'll apply the fix:
- Assistant
Now let me look at an existing test that inspects inputs/projections, to match test style:
- Assistant
The new test passes. Let me verify it actually fails without the fix, then run the full crate suite plus fmt/clippy:
- Assistant
Two coral-app test failures appeared — let me check whether they're pre-existing or caused by my change:
- Assistant
The output got swallowed — let me redo that carefully:
- Assistant
Done. Summary of the fix:
Change
crates/coral-spec/src/v4/surfaces/openapi/operations.rs:158— Inimport_parameters, path parameters are now imported as required unconditionally (the OpenAPI spec mandatesrequired: trueforin: path), while non-path parameters keep the existing explicit behavior (requiredfield honored, defaulting tofalsewhen omitted). SinceRestParameterBinding.requiredand the projection layer (derive.rs:109) both derive fromIrOperationInput.required, the fix flows through to REST bindings and SQL projections automatically.Coverage
crates/coral-spec/src/v4/openapi_tests.rs— new testimporter_treats_path_parameters_as_required_when_field_is_omittedasserting:- a path parameter with omitted imports as required (IR input + REST parameter binding)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.