Semantic error for "in: formData" Parameters and proper "consumes"
See original GitHub issuea ‘consumes’ property is defined as required in the top level, but editor shows error:
Semantic error at paths./path1.post Operations with Parameters of “in: formData” must include “application/x-www-form-urlencoded” or “multipart/form-data” in their “consumes” property
Q | A |
---|---|
Bug or feature request? | Bug |
Which Swagger/OpenAPI version? | 2.0 |
Which Swagger-Editor version? | latest online version |
How did you install Swagger-Editor? | using http://editor.swagger.io/# |
Which broswer & version? | chrome 63.0.3239.84 |
Which operating system? | macOS 10.13.2 |
Demonstration API definition
swagger: '2.0'
info:
title: 'Demonstration of "consumes" problem'
version: v1
basePath: /
consumes:
- application/x-www-form-urlencoded
- multipart/form-data
paths:
/path1:
post:
parameters:
- name: param1
type: string
in: formData
responses:
'200':
description: ok
Expected Behavior
Error should not be displayed
Current Behavior
Error is displayed even though the swagger definition is valid
Possible Solution
Context
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Parameters cannot have both a "in: body" and "in: formData ...
I am using the latest OpenAPI feature. I've been able to produce a simple sample using the latest nugget packages that shows the...
Read more >Swagger 2.0 semantic error with $ref to path parameter
The problem is that id is actually defined, only it appears that the check which throws this error is occurring before the $ref...
Read more >OpenAPI Specification - Version 2.0 - Swagger
If type is "file" , the consumes MUST be either "multipart/form-data" , " application/x-www-form-urlencoded" or both and the parameter MUST be in "formData"...
Read more >Best practices for REST API design - Stack Overflow Blog
Best practices for REST API design · Accept and respond with JSON · Use nouns instead of verbs in endpoint paths · Name...
Read more >FormData - Web APIs | MDN
Chrome Edge
FormData Full support. Chrome5. Toggle history Full support. Edge12. Toggl...
@@iterator Full support. Chrome50. Toggle history Full support. Edge18. Toggl...
FormData() constructor Full support....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
fixed (again!), thanks for the heads up @elasti-ron!
@shockey - thanks for fixing this earlier. It is now happening again. As I cannot reopen this issue, I’ve opened a new one (#1684).