Skip to content
TheChatArchiveThe Chat Archive
composer-2.5· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

Resolve OpenAPI $ref response objects during DSL v4 import Problem DSL v4 OpenAPI import…

  1. 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_response calls select_json_response, and select_json_response looks for content directly on each response object without first resolving $ref.

    Code references:

    • crates/coral-spec/src/v4/mod.rs:972
    • crates/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: object
    

    Impact

    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 200 response that references #/components/responses/... and verifies the projection is published.

    Interface

    No new interfaces are introduced.

  2. Assistant

    I'll inspect the OpenAPI import path and how other $ref types are resolved so we can apply the same pattern to response refs.

  3. Assistant

    Resolving response $refs in select_json_response using the same resolve_ref path as parameters and request bodies.

  4. Assistant

    Fixing a bug: candidates was consumed twice in the selection logic.

  5. Assistant

    Adding the regression test:

  6. Assistant

    Merging duplicate impl blocks for cleanliness.

  7. Assistant

    Response $refs are now resolved before JSON response selection, matching how parameters and request bodies are handled.

    Change

    select_json_response is now a method on OpenApiImporter that calls resolve_ref on each response object before looking for content.application/json. That reuses the existing ref machinery:

    • Internal refs (#/components/responses/...) are resolved via document.pointer()
    • External refs emit OPENAPI_EXTERNAL_REF_UNSUPPORTED
    • Missing refs emit OPENAPI_REF_NOT_FOUND

    Regression test

    importer_resolves_response_refs_before_selecting_json_content covers a 200 response with $ref: '#/components/responses/Foo', asserts OutputCardinality::List, and verifies the items table projection is published.

    All 9 OpenAPI tests pass.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.