Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityError
MessageMime types defined for file type parameter are invalid.
CodeSWAGGER20STANDARDS_V106
TypeValidation
Rule SystemSemantic
Broad CategoryParameters
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsswagger2 swagger standards semantic validation mime mime type type file parameter

Suggested Fixes

  • Ensure that the consumes property only contains either application/x-www-form-urlencoded, multipart/form-data or both mime types only.
  • The mime types are compared in a case-sensitive manner.

For More Information