prism: [BUG] Prism should support */* by default for DELETE

I have a simple DELETE endpoint and want to return empty with a 204

Documentation says

“Some responses, such as 204 No Content, have no body. To indicate the response body is empty, do not specify a content for the response”

https://swagger.io/docs/specification/describing-responses/

 /api/calls/{id}:
    delete: # DELETE
      tags:
        - Calls
      description: Delete a call history item
      parameters:
        - $ref: '#/components/parameters/id'
      responses:
        204:
          description: OK
        400:
          description: NOK
        500:
          description: ERROR
components:
    id:
      in: path
      name: id
      description: id for the item
      required: true
      schema:
        type: integer
        format: int64

curl -X DELETE "http://127.0.0.1:4010/api/calls/1" -H "accept: */*"
or
curl -X DELETE "http://127.0.0.1:4010/api/calls/1"  
{
detail: "Unable to find content for application/json, text/plain, */*"
status: 406
title: "The server cannot produce a representation for your accept header"
type: "https://stoplight.io/prism/errors#NOT_ACCEPTABLE"        
}   

The following is a workaround but it seems like it is pollution in my spec file

  /api/calls/{id}:
    delete: # DELETE
      tags:
        - Calls
      description: Delete a call history item
      parameters:
        - $ref: '#/components/parameters/id'
      responses:
        204:
          description: OK
          content:
            '*/*':
              schema:
                type: string
        400:
          description: NOK
        500:
          description: ERROR

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 4
  • Comments: 25 (11 by maintainers)

Most upvoted comments

Il problema è nei generatori automatici che solitamente puzzano de merda — provo a dare un occhio al tuo documento e vedere di chi è la colpa 😃

I still see this issue while using version 3.1.1.

When I do with a global install it seems like its fixed. But, I have not globally installed the @stoplight/prism-cli npm package. I want to trigger it in my application source code.

@XVincentX, can you help verify this?