valid-mime-types-for-file-type-parameter
Overview
This rule belongs to the swagger-v2-standards-validation
ruleset and states that:
For parameters having type file
, the consumes
property must be either multipart/form-data
, application/x-www-form-urlencoded
or both only.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Mime types defined for file type parameter are invalid. |
Code | SWAGGER20STANDARDS_V106 |
Type | Validation |
Rule System | Semantic |
Broad Category | Parameters |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | swagger2 swagger standards semantic validation mime mime type type file parameter |
Suggested Fixes
- Ensure that the
consumes
property only contains eitherapplication/x-www-form-urlencoded
,multipart/form-data
or both mime types only. - The mime types are compared in a case-sensitive manner.