oxidecomputer / oxidecomputer/progenitor
Support for multiple `requestBody` content types
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1k
- Forks
- 136
- Avg merge
- 8h 36m
- Merged PRs (30d)
- 14
Description
In some schemas the requestBody has multiple content types. Here's an example from the github API:
"operationId": "markdown/render-raw",
"requestBody": {
"content": {
"text/plain": {
"schema": {
"type": "string"
}
},
"text/x-markdown": {
"schema": {
"type": "string"
}
}
}
},
In that scenario we'd like to allow consumers to specify either content encoding. I'd suggest we do something like this:
pub enum MarkdownRenderRawBody {
TextPlain(String),
XMarkdown(String),
}
fn foo(client: &Client) {
let _ = client.markdown_render_raw().body(MarkdownRenderRawBody::TextPlain("xyz".to_string())).send.await;
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the generator handles OpenAPI requestBody content schemas and how generated request builders expose bodies. Use the GitHub API example in the issue as a case to follow. Done means generated clients accept either listed content type through a typed body API, with coverage for multiple requestBody content types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100