Skip to content

multipartRequestBody

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/libs/parser-core/src/openapi/multipart.ts

The OpenAPI requestBody for a multipart handler.

formSchema is the JSON schema the DTO resolver produced for the same handler's @Body() (or equivalent). A handler that takes BOTH a file and a DTO does not take two bodies — the DTO's fields are text parts of the SAME multipart body — so they are folded in beside the file parts rather than published as a competing application/json content type. A top-level $ref is followed one hop through components so a registered DTO still contributes its fields (an un-dereferenced $ref would silently contribute none).

Signature

ts
function multipartRequestBody(body: MultipartBody, formSchema: Record<string, unknown>, components: Record<string, unknown>): Record<string, unknown>

Parameters

NameType
bodyMultipartBody
formSchemaRecord<string, unknown>
componentsRecord<string, unknown>

Returns: Record<string, unknown>

Was this page helpful?

Download as PDF