Skip to content

Q: OpenAPI for streamed JSON request body & asking about IAsyncEnumerable<T> input support #62391

Answered by mikekistler
ryanelian asked this question in Q&A
Discussion options

You must be logged in to vote

How do I decorate the action so that OpenAPI documentation shows “array of Data in the request body”

If you are using .NET 9 and the built-in OpenAPI document generation, you could use an operation transformer to add the request body on that operation. The operation transformer will run for all operations and you'll have to filter to just the one you want to update.

Is manual streaming still the right approach, or can MVC now bind directly to IAsyncEnumerable?

I think manual streaming is still the right (only?) approach.

Any gotchas when using the manual Request.Body approach?

Just the one you've already encountered -- you need to fix the OpenAPI metadata to get an accurate API desc…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ryanelian
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants