Skip to content
TheChatArchiveThe Chat Archive
fable-5· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

Treat OpenAPI path parameters as required in v4 import This tracks unresolved feedback…

  1. 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 required is 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 required field, preserve explicit behavior for non-path parameters, and add focused importer/projection coverage.

    Interface

    No new interfaces are introduced.

  2. Assistant

    Now I'll make the fix in operations.rs:

  3. Assistant

    Now let's look at the test files to add coverage:

  4. Assistant

    Now add the importer test in openapi_tests.rs:

  5. Assistant

    Now add the projection test:

  6. Assistant

    Two failures in coral-app grpc tests. Let me check if they're related to my change or pre-existing:

  7. Assistant

    Done. Summary of the fix:

    Change

    crates/coral-spec/src/v4/surfaces/openapi/operations.rs — in import_parameters, path parameters are now imported as required regardless of an omitted required field, per the OpenAPI spec (which mandates required: true for in: path):

    required: location == OpenApiParameterLocation::Path
        || parameter_obj
            .get("required")
            .and_then(Value::as_bool)
            .unwrap_or(false),
    

    Non-path parameters keep the existing behavior: explicit required is honored, omitted defaults to optional. The fix flows through to RestParameterBinding and projections automatically since both derive from IrOperationInput.required.

    Tests added

    • openapi_tests.rs::importer_treats_path_parameters_as_required_when_field_is_omitted — importer-level: a path param with omitted required imports as required; query params with omitted / false / true keep their explicit or default behavior, on both IrOperationInput and the REST parameter bindings.
    • projection_tests.rs::projection_generation_treats_path_inputs_as_required_when_field_is_omitted — projection-level: a singleton operation whose only required input is a path param lacking required now projects as a TableFunction (kind Table) with the path input marked required, instead of a plain table with an optional SQL filter (the misclassification from the issue).

    Verification

    • cargo test -p coral-spec --lib: 221 passed
    • cargo test --workspace --no-fail-fast: all pass except delete_restores_artifacts_on_cleanup_failure and import_rolls_back_on_config_write_failure in coral-app's grpc suite — verified pre-existing on clean HEAD (they rely on chmod-based permission denial, which is a no-op when running as root)
    • cargo clippy -p coral-spec --all-targets and cargo fmt --check: clean

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.