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’s existing reference-resolution and diagnostic patterns, then patch response selection and add the focused regression test. I’ll run the targeted tests first and the required Rust gate afterward.
- Assistant
rgisn’t installed in this workspace, so I’m switching togrep/findand continuing the same inspection. - Assistant
The importer already has a shared
resolve_refhelper that emitsOPENAPI_REF_NOT_FOUNDandOPENAPI_EXTERNAL_REF_UNSUPPORTED, and parameters/request bodies use it directly. I’ll route each successful response candidate through that same helper before inspecting its media types, preserving the existing 200-then-lowest-2xx selection behavior. - Assistant
The implementation and regression test are in place. The targeted test is compiling now; after it passes I’ll add/verify the two diagnostic cases and run formatting plus the repository Rust checks.
- Assistant
The focused OpenAPI suite passes, including publication and both shared diagnostic codes. Formatting found one rustfmt-only
let-elselayout change; I’m applying it, then running the full mandatedmake rust-checks. - Assistant
The full gate completed formatting and workspace Clippy successfully, then stopped because this environment lacks the
cargo-nextestbinary (and internet use is disallowed). I’ll compensate with the completecoral-spectest suite and report that infrastructure 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.