Visitar URL original
ValidateRequestBody calls io.ReadAll causing OOM issues where we want streaming · Issue #1814 · oapi-codegen/oapi-codegen · GitHub
The Wayback Machine - https://web.archive.org/web/20251105103426/https://github.com/oapi-codegen/oapi-codegen/issues/1814
Skip to content

ValidateRequestBody calls io.ReadAll causing OOM issues where we want streaming #1814

@Southclaws

Description

@Southclaws

I noticed a few OOMs for large asset uploads while testing on a small memory-constrained server to ensure Storyden runs nicely on small low-power machines. It seems ValidateRequestBody is calling io.ReadAll so even though I thought we were doing a streaming read for file uploads, the actual full request body is still read entirely into memory. This is a huge problem for image-heavy and document-heavy services.

Is there a way to tell oapi-codegen to skip this for one specific endpoint?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions