Skip to content

Conversation

nmeheus
Copy link
Contributor

@nmeheus nmeheus commented Aug 17, 2025

All parts of a multipart/form-data request that are decoded using the PlainBodyDecoder (which is the default for omitted or text/plain parts) are considered to be of type string without these parts being parsed according to their specified schema.
This has been amended and tested in this PR.
This implementation relies on the fact that either an omitted or specified text/plain Content-Type part header will result in a string typed value.
Only parsing of primitive values is supported, as there seems no specifications available for array of object typed parts, as is the case for the different types of supported parameters according to OpenAPI. If this were to change, it should be relatively straightforward to amend the code to make use of an additional implementation of the valueDecoder interface specifically for this purpose.

@fenollp fenollp linked an issue Aug 21, 2025 that may be closed by this pull request
@fenollp fenollp changed the title Issue 949 - Support primitive parsing for individual text like parts in multipart/form-data openapi3filter: support primitive parsing for individual text like parts in multipart/form-data Aug 21, 2025
@fenollp fenollp merged commit a33c5f8 into getkin:master Aug 21, 2025
5 checks passed
@fenollp
Copy link
Collaborator

fenollp commented Aug 21, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

multipart/form-data - validation fails
2 participants