Skip to content

Is it possible to generate a model for multipart requests? #4976

Answered by baywet
AndrewL97 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for sharing this. I'm not sure why the FromForm attribute results in the description splitting the schema here. IMHO it should be identical to the description of WithFile endpoint. Maybe worth having @captainsafia take a look at that.

As for your initial question, using the multipart body object, you should be able to add parsable body parts with the add or replace part method. (i.e. just add your model value with application/json as the media type and the property name (casing needs to match) as the part name)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@AndrewL97
Comment options

@baywet
Comment options

baywet Jul 17, 2024
Collaborator

Answer selected by baywet
@MMAndrewL
Comment options

@baywet
Comment options

baywet Jul 19, 2024
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants