ISSUE DESCRIPTION Resolve OpenAPI $ref response objects during DSL v4 import Problem DSL…
- User
ISSUE DESCRIPTION
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.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to use or before submitting your changes. In fact, only submits currently unstaged changes because it uses to get the changes that need to be submitted. - Assistant
I'll start by exploring the repository structure and the referenced code locations to understand how OpenAPI response imports currently work.
- Assistant
The referenced line numbers are outdated—I'll locate
import_responseandselect_json_responseand inspect how$refresolution works elsewhere. - Assistant
rg is not found, let me use grep instead.
- Assistant
Let me read the responses.rs file and resolve_ref, and look at how parameters resolve refs for diagnostics consistency.
- Assistant
I'll inspect how parameters handle refs and review the existing OpenAPI tests for patterns.
- Assistant
I'll update
select_json_responseto resolve response$refs first, then add a regression test covering component response refs. - Assistant
I need to update
select_json_responseand fix theresolve_refcall so it takes a reference to the owned schema. - Assistant
Next I'll convert
select_json_responseinto a method onOpenApiImporterthat resolves response$refs. - Assistant
I'll check the full file for structural issues, then add the regression test.
- Assistant
I'll append regression tests for resolved component response refs and for missing/external response diagnostics.
- Assistant
Let me append tests at the end of the file.
- Assistant
There's a duplicate assertion line to remove.
- Assistant
There's a double closing brace I need to remove.
- Assistant
I'll verify how identifiers and entity type refs are normalized so the test assertions match, then run the tests.
- Assistant
I'll check how identifier normalization works on operation IDs.
- Assistant
Running the openapi tests to verify the fix.
- Assistant
All openapi tests passed. I'll run the full coral-spec suite next to confirm nothing else broke.
- Assistant
All tests passed. I'll review the final diff, then submit.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.