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:
responses: '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 trace the v4 importer and its existing ref-diagnostic patterns, then patch the response selection path and add the projection-level regression test.
- Assistant
rgisn’t installed in this workspace, so I’m switching to focusedgrep/sedinspection and keeping the search scoped to the importer. - Assistant
The importer already has a shared resolver that emits
OPENAPI_EXTERNAL_REF_UNSUPPORTEDandOPENAPI_REF_NOT_FOUND. I’ll route response objects through that same resolver before inspectingcontent, preserving the existing schema-ref behavior afterward. - Assistant
The regression is in place and compilation has started. I’m also going to add direct coverage for missing and external response refs so the diagnostic requirement is locked to the shared resolver’s existing codes.
- Assistant
Targeted tests now pass, including referenced-response publication and both unresolved-ref diagnostic cases. I’m running the repository’s required Rust gate next; this may take a little while.
- Assistant
Formatting and workspace Clippy passed. The repository gate then stopped because this environment lacks the
cargo-nextestexecutable; I’m substituting the fullcoral-spectest suite with Cargo’s built-in test runner and will report that tooling limitation explicitly.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.