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 trace the v4 importer’s existing ref-resolution and diagnostics patterns, then patch the response selection and add the focused regression test. Afterward I’ll run the relevant crate tests and the mandated Rust checks.
- Assistant
rgisn’t installed in this workspace, so I’m switching to targetedgrep/findinspection. No implementation change yet. - Assistant
The importer already has one shared resolver that emits
OPENAPI_REF_NOT_FOUNDandOPENAPI_EXTERNAL_REF_UNSUPPORTED. I’ll reuse it at the response-object level, return an owned schema from selection, and preserve the current preference for status 200 over other 2xx responses. - Assistant
The focused test build is running. The first formatting check found only a rustfmt line-break adjustment; I’ll apply rustfmt after the test process completes, then rerun the checks cleanly.
- Assistant
The regression and diagnostic tests pass: the referenced array response now yields a published projection, while missing and external response refs emit the same shared diagnostic codes used elsewhere. Formatting and diff checks are clean; I’m running the repository’s required full Rust gate now.
- Assistant
The full gate’s formatting and all-feature clippy stages passed. Its test stage cannot start because this environment lacks the
cargo-nextestexecutable; without network/installing tools, I’m running the equivalent workspace/all-target/all-feature tests through Cargo’s built-in test runner instead. - Assistant
The built-in full suite is exposing unrelated harness assumptions: two filesystem-permission tests fail under this root container, and many CLI integration tests are colliding under Cargo’s parallel execution (the project normally relies on nextest configuration). I’m letting
--no-fail-fastfinish so the final verification report is complete; the focused coral-spec suite remains green.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.