You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
System Information:
OS & version: MacOS 14.3
Specmatic version: 2.0.17
JDK version: 21
The text was updated successfully, but these errors were encountered:
I apologize for the delayed response on this issue. You're right - Specmatic currently doesn't support cookie parameters in API calls, even when specified as required in the OpenAPI spec.
I've marked this as an enhancement since this would be a valuable addition to our cookie parameter handling capabilities. We'll keep you posted on the progress through this issue.
Thank you for taking the time to report this with such clear examples, it really helped!
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:
The text was updated successfully, but these errors were encountered: