oxidecomputer / oxidecomputer/progenitor

Multiple response types not supported

Open
#344 7 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1k
Forks
136
Avg merge
8h 36m
Merged PRs (30d)
14

Description

It is not possible currently to have two response types due to the assert at
https://github.com/oxidecomputer/progenitor/blob/1b942d1/progenitor-impl/src/method.rs#L1118-L1120

I wonder if it is easier and acceptable to slightly improve the situation by allowing one response body type, and one or more additional responses that do not include a body.

e.g. the following fails the assertion, but the second response has no content

          responses:
            '200':
              description: Success
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/User'
            # Definition of all error statuses
            default:
              description: Unexpected error

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read progenitor-impl/src/method.rs at lines 1118-1120 and trace how response schemas are selected. Use the YAML example as the acceptance case: allow one response with a body alongside additional responses without content, without triggering the assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, rust
Domain
api, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.