Resolve OpenAPI $ref response objects during DSL v4 import Problem DSL v4 OpenAPI import…
- User
Resolve OpenAPI $ref response objects during DSL v4 import
Problem
DSL v4 OpenAPI import currently misses valid response objects that are expressed as
$refs.import_responsecallsselect_json_response, andselect_json_responselooks forcontentdirectly on each response object without first resolving$ref.Code references:
crates/coral-spec/src/v4/mod.rs:972crates/coral-spec/src/v4/mod.rs:1290
A valid OpenAPI shape like this is treated as if the operation has no JSON response:
yamlresponses: '200': $ref: '#/components/responses/Foo' components: responses: Foo: content: application/json: schema: type: array items: type: objectImpact
The importer falls through to
OutputCardinality::None, which causes otherwise valid read operations to be hidden/dropped from the generated projection catalog. This can make major portions of a real OpenAPI descriptor disappear from DSL v4 sources.Acceptance criteria
- Response
$refs under operation responses are resolved before selecting JSON responses. - Missing or external response refs produce diagnostics consistent with existing schema/parameter ref diagnostics.
- A regression test covers a
200response that references#/components/responses/...and verifies the projection is published.
Interface
No new interfaces are introduced.
- Assistant
I’ll inspect the v4 importer and its existing ref-resolution diagnostics/tests, then patch the response path and run the focused tests plus the required Rust gate if feasible.
- Assistant
rgisn’t installed in this workspace, so I’m switching togrep/findand continuing the same inspection. - Assistant
The importer already has one shared resolver that emits
OPENAPI_REF_NOT_FOUNDandOPENAPI_EXTERNAL_REF_UNSUPPORTED. I’ll route each eligible 2xx response object through it before inspectingcontent, preserving the existing response-selection preference for 200. - Assistant
The referenced-response regression now passes and produces a published table projection. I’m adding explicit coverage for both unresolved local response refs and unsupported external response refs before running the broader crate suite.
- Assistant
The full
coral-specsuite passes (206 unit tests plus doctests), and the diff is clean. I’m running the repository’s required all-features Rust checks now. - Assistant
Formatting and all-features Clippy passed. The gate then stopped because this environment lacks
cargo-nextest; I’m using the equivalent workspace/all-targets/all-features test command as the local fallback. - Assistant
The fallback reached the workspace tests; unrelated filesystem-permission tests are failing under the container’s root user, and one CLI test is currently slow. The targeted crate and all-features compile/Clippy remain clean; I’m letting the fallback finish so I can report its exact status.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.