One possible option would have been to create an inner class such as Part, but I didn't adopt it because it would require relatively many changes to the codebase.
Testing Instructions
Add an unit test in serialization package
Set up reproducible environment for the issue, and confirm that this PR fix that
Overview
Add support for MultipartBody filename parameter
Related Issue
Fixes #398
Demo
N/A
Notes
Part
, but I didn't adopt it because it would require relatively many changes to the codebase.Testing Instructions
OpenAPI Spec
```yaml { "openapi": "3.0.2", "info": { "title": "Custom title", "summary": "This is a very custom OpenAPI schema", "description": "Here's a longer description of the custom **OpenAPI** schema", "version": "3.0.2" }, "paths": { "/": { "get": { "summary": "Root", "operationId": "root__get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "string", "title": "Response Root Get" } } } } } } }, "/upload": { "post": { "summary": "Upload", "operationId": "upload_upload_post", "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload_upload_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "integer", "title": "Response Upload Upload Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } } }, "components": { "schemas": { "Body_upload_upload_post": { "properties": { "name": { "type": "string", "title": "Name" }, "file": { "type": "string", "format": "binary", "title": "File" } }, "type": "object", "required": [ "name", "file" ], "title": "Body_upload_upload_post" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" } } } } ```