required-media-type-schema-for-multipart-request-body
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
The request body multipart media type definition must contain a schema
property to define the input parameters to the operation.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Required schema definition for multipart request body media type is missing. |
Code | OPENAPI3STANDARDS_V130 |
Type | Validation |
Rule System | Semantic |
Broad Category | Media Types |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation schema multipart media type body request |
Suggested Fixes
- Your request body definition would consist of a
content
property withmultipart
media type e.g.multipart/form-data
. Ensure the Media Type Object defined in this content media type contains the propertyschema
. - Ensure that the
schema
property provides a valid Schema Object definition. - The schema must define an object with properties. Here, each property will represent a multipart input parameter that needs to be sent in the request.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#media-type-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#special-considerations-for-multipart-content
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#request-body-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#media-type-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#request-body-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/