oxidecomputer / oxidecomputer/dropshot

Allowing other content types for json

Open
#441 2 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

looking through the code, https://github.com/oxidecomputer/dropshot/blob/5063b8df2238fd1e3c67c5bc39e2cbd60e69465c/dropshot/src/handler.rs#L1018-L1026, I think currently content types for json besides application/json aren't supported

my use case is I'm trying reimplement an AWS api where the client uses a application/x-amz-json-1.0 header for json so being able to have a route take a custom json content type would be useful

edit: as a work around I think I could skip parsing the body as json, but then I'd lose the fancy open api stuff

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 in dropshot/src/handler.rs at lines 1018-1026, where JSON content types are handled. Trace how request-body parsing and OpenAPI metadata are connected, then determine how a route could accept a custom JSON content type such as application/x-amz-json-1.0 without losing JSON parsing or OpenAPI support. Done means the requested content type is supported for route bodies and covered by the relevant tests.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.