oxidecomputer / oxidecomputer/dropshot

Support schema for multipart requests

Open
#1,345 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.2k
Forks
104
Avg merge
1d 19h
Merged PRs (30d)
22

Description

Currently, multipart bodies always create an API schema like this:

"content": {
  "multipart/form-data": {
    "schema": {
      "type": "string",
      "format": "binary"
    }
  }
}

In my dropshot API, my request handler accepts this multipart body and then extracts parts from it. I expect some parts to conform to some schema. e.g. "first part should be a Person, second part should be a Workplace". This is not captured at all in the schema that Dropshot generated above, but it is required by the actual endpoint implementation code I wrote.

But the OpenAPI spec supports using detailed schemas that explain each part's expected type. So in theory Dropshot could generate a more detailed schema that captures my expectations for each part.

As the person who originally added multipart support, this oversight is purely due to me being silly a few years ago, and I think this gap should be fixed.

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

Start by tracing how Dropshot currently generates the multipart request schema described in the issue, then compare that behavior with the linked OpenAPI multipart documentation. Done means the generated schema represents the expected type of each multipart part rather than treating the whole body as a binary string.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.