Skip to content

feat: support application/octet-stream req/res bodies #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mnahkies
Copy link
Owner

@mnahkies mnahkies commented Aug 9, 2025

  • adds support for application/octet-stream content types for both request and response bodies
  • introduces some associated helper functions, notably uses raw-body for the request body parsing side of things. It might make sense to see if we could always use this and drop the other body parsers

@@ -10875,7 +10875,7 @@ export class StripeApiService {
| Server<"getQuotesQuotePdf_StripeApiService">
| string = StripeApiServiceServers.operations.getQuotesQuotePdf().build(),
): Observable<
| (HttpResponse<string> & {status: 200})
| (HttpResponse<Blob> & {status: 200})
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: add responseType: "blob" to the HttpClient call

@@ -134,7 +136,7 @@ router.${builder.method.toLowerCase()}(\`${builder.route}\`, async (req: Request
const input = {
params: ${params.path.schema ? `parseRequestInput(${symbols.paramSchema}, req.params, RequestInputType.RouteParam)` : "undefined"},
query: ${params.query.schema ? `parseRequestInput(${symbols.querySchema}, req.query, RequestInputType.QueryString)` : "undefined"},
body: ${params.body.schema ? `parseRequestInput(${symbols.requestBodySchema}, req.body, RequestInputType.RequestBody)` : "undefined"},
body: ${params.body.schema ? (params.body.contentType === "application/octet-stream" ? `parseRequestInput(${symbols.requestBodySchema}, await parseOctetStream(req), RequestInputType.RequestBody)` : `parseRequestInput(${symbols.requestBodySchema}, req.body, RequestInputType.RequestBody)`) : "undefined"},
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: this is getting a bit out of hand

// TODO: support more serializations
// | "Blob"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: update documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant