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
Describe the bug
When parameter is set with all section in a ref data file and filled with env variable, it's not resolved for PUT operation.
Example of ref data:
all:
id: $$NEW_ID
where NEW_ID was set to "1"
And path like /Brand/{id}
will result in .../Brand/1 for GET (which is expected),
but in .../Brand/$$NEW_ID for PUT (which is not expected).
To Reproduce
Reference data file "reference.yml" :
all:
id: $$NEW_ID
Set $$NEW_ID as env variable, define its value
Run cats --contract=${CONTRACT_URL} --server=${SERVER_URL} --httpMethods=GET,PUT --refData="reference.yml" setting
Expected behaviour
Env variable is replaced by it's value for PUT request.
Environment:
Key
Value
OS Name
Mac OS X
OS Version
14.6
OS Arch
amd64
Binary Type
native
Cats Version
13.1.0
Cats Build
2025-01-17T06:37:06Z
Term Width
211
Term Type
xterm-256color
Shell
/bin/zsh
Example of OpenApi:
openapi: 3.0.0
info:
title: Brand API
version: "1.0.0"
paths:
/Brand/{id}:
get:
summary: Retrieve a brand by ID
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: A brand object
content:
application/json:
schema:
$ref: '#/components/schemas/Brand'
'404':
description: Brand not found
put:
summary: Update a brand by ID
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Brand'
responses:
'200':
description: Updated brand object
content:
application/json:
schema:
$ref: '#/components/schemas/Brand'
'400':
description: Invalid input
components:
schemas:
Brand:
type: object
properties:
id:
type: string
name:
type: string
required:
- id
- name
The text was updated successfully, but these errors were encountered:
Describe the bug
When parameter is set with all section in a ref data file and filled with env variable, it's not resolved for PUT operation.
Example of ref data:
where NEW_ID was set to "1"
And path like
/Brand/{id}
will result in
.../Brand/1
for GET (which is expected),but in
.../Brand/$$NEW_ID
for PUT (which is not expected).To Reproduce
cats --contract=${CONTRACT_URL} --server=${SERVER_URL} --httpMethods=GET,PUT --refData="reference.yml"
settingExpected behaviour
Env variable is replaced by it's value for PUT request.
Environment:
Example of OpenApi:
The text was updated successfully, but these errors were encountered: