Forum Discussion

shoaibalam's avatar
shoaibalam
New Contributor
7 years ago

Missing matching response for specified Accept header

I have an accept header    - name: Accept in: header type: string required: true description: application/json; version=1.0.0 default: application/json; version=1.0.0   The corresponding Cur...
  • HKosova's avatar
    7 years ago

    Hi shoaibalam,

     

    The produces keyword is what defines the Accept header in requests. The Accept header is not supposed to be defined explicitly as a header parameter. Remove the Accept parameter and add the following instead:

    paths:
      /rewards:
        post:
          consumes:
            - application/json  # <-- Content-Type header
          produces:
            - application/json; version=1.0.0  # <-- Accept header

    Check out our OpenAPI 2.0 syntax guide for details:

    Describing Parameters

    MIME Types