feat: add streaming multipart file-server playground - #71
Merged
fredbi merged 5 commits intoJul 27, 2026
Merged
Conversation
fredbi
reviewed
Jul 24, 2026
Keep generated streaming binding limited to constructing and passing MultipartFormStream. Let the handler own multipart traversal, required-file checks and application-specific validation, and demonstrate discovered field and file state in the black-box streaming test. Signed-off-by: Филимоненков Павел Анатольевич <p.filimonenkov@office.st-falcon.ru>
fpawel
marked this pull request as ready for review
July 24, 2026 16:06
fredbi
reviewed
Jul 24, 2026
fredbi
left a comment
Contributor
There was a problem hiding this comment.
Yep that’s the right shape as far as i can tell.
This PR may move to a distinct version of the example (or perhaps two operations showing the 2 operating modes not sure yet) after we are able to generate the proper bindings from go-swagger.
Prototype is convincing.
fredbi
approved these changes
Jul 27, 2026
Contributor
|
I think you made it through with the full round-trip: openapi lib -> go swagger -> examples excellent feature imho. Thanks a lot @fpawel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Experimental integration playground for go-openapi/runtime#507.
This manually adapts the generated
file-serverbinder to demonstrate theintended future go-swagger code generation and handler ownership model.
It is not intended for merge until the runtime API and code generation approach
are settled.
What it demonstrates
MultipartFormStreamto the handler;Drain()andClose();http.MaxBytesHandlerlimit propagates through the streamed reader and results in HTTP 413.Black-box test
The integration test uses a real
httptest.Serverand anio.Piperequest body.The client sends the multipart headers and the first file bytes, then pauses.
The test verifies that the generated router, binder and handler have already
received and started reading the file before the client resumes and finishes
the multipart body.
The generated binder is currently adapted manually to represent the expected
future code generation.