Description
Specmatic does not send Cookie in the API calls even when it is a required parameter for the API. This leads to failure of API call and ultimately of the specmatic API contract test even when the implementation is actually respecting the contract
I suspect this is happening because of dynamic http headers being removed the request but I can be wrong
I have tried adding an example for the param like below but still no luck
- name: session_id
in: cookie
required: true
schema:
type: string
description: A required cookie parameter that contains the session ID.
examples:
syn_200:
value: 1234
Steps to reproduce
run specmatic contract test on an api spec which contains required Cookie param for a path
example opeanapi spec
openapi: 3.0.3
info:
title: TODO API
description: API to retrieve a list of TODO items, requiring a cookie for authentication.
version: 1.0.0
paths:
/todos:
get:
summary: Get a list of TODO items
description: Retrieves a list of TODO items. Requires a valid session cookie for authentication.
parameters:
- name: session_id
in: cookie
required: true
schema:
type: string
description: A required cookie parameter that contains the session ID.
responses:
'200':
description: A list of TODO items
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: integer
title:
type: string
completed:
type: boolean
examples:
example-success:
summary: Successful TODO list retrieval
value:
- id: 1
title: "Buy groceries"
completed: false
- id: 2
title: "Pay utility bills"
completed: true
Expected behavior
I am expecting the Cookie param to be sent in the API call just like query and path params
Description Specmatic does not send Cookie in the API calls even when it is a required parameter for the API. This leads to failure of API call and ultimately of the specmatic API contract test even when the implementation is actually respecting the contract
I suspect this is happening because of dynamic http headers being removed the request but I can be wrong
I have tried adding an example for the param like below but still no luck
Steps to reproduce run specmatic contract test on an api spec which contains required Cookie param for a path
example opeanapi spec
Expected behavior I am expecting the Cookie param to be sent in the API call just like query and path params
System Information: