-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
On 2018/04/08, the v3.0 specification I had worked was not shown as having errors in SwaggerHub. The following morning, 2018/04/09, immediately upon opening the specification the error message appeared saying "DELETE operations cannot have a requestBody".
The API I was working indeed is a DELETE method having a request payload. So the error message is correct. However, several servers accept a payload with a delete method, and on the previous months this API was being documented using SwaggerHub, no such error message was displayed.
So I am wondering if SwaggerHub was updated sometime between Sunday afternoon PST on 4/8 and Monday morning PST on 4/9. And if so, is there a conscious attempt to more rigorously enforce a standard that doesn't permit a payload to accompany a DELETE request?
I've cross checked yesterday's work by copying the last commit I made into the SwaggerHub editor. The error message appears, while at the same time yesterday's work shows up fine on my testing server. Thus I am sure I did not introduce a change to the API file in SwaggerHub after finishing yesterday.
I created a smaller API specification on SwaggerHub that demonstrates the error I am seeing. https://app.swaggerhub.com/apis/mikefidel/BUG-Delete-Method-Having-RequestBody/1.0.0
Q | A |
---|---|
Bug or feature request? | Bug |
Which Swagger/OpenAPI version? | 3.0 |
Which Swagger-UI version? | current SwaggerHub version |
How did you install Swagger-UI? | problem does not occur in v3.13.0 which is used for testing |
Which browser & version? | Chrome latest |
Which operating system? | Windows 10 |
Demonstration API definition
Found at SwaggerHub []https://app.swaggerhub.com/apis/mikefidel/BUG-Delete-Method-Having-RequestBody/1.0.0)
openapi: 3.0.0
info:
version: '1.0.0'
title: 'Bug-Delete-Method-Has-RequestBody'
description: "On 2018/04/08 SwaggerHub considered this acceptable. Today (2018/04/09) an error message is displayed saying DELETE operations cannot have a requestBody."
servers:
- url: http://test.ndexbio.org/v2
description: "NDEx test server"
paths:
/networkset/members:
delete:
summary: Delete Networks from Network Set
requestBody:
content:
application/json:
schema:
type: array
description: "List of networks belonging to this network set"
items:
type: string
format: uuid
description: "Network object UUID"
example: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
responses:
500-response:
description: "Sloppy cut-paste - ignore this response"
Expected Behavior
No error message appears.
Current Behavior
Error message appears.
Possible Solution
Not upgrading to Swagger-UI releases after 3,13,0.
Context
As the error does not appear on our older 3.13.0 test system, we'll not be upgrading to later versions.