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
[specmatic] 28-08-2024 17:06:46 debug: Test: "Load Error FAILED"
Reason: Error loading test data for Scenario: GET /service/application/content/v1.0/announcements -> 200
>> RESPONSE.BODY.$ref
The key $ref was found in the example success but was not in the specification
Expected behavior
Should resolve ref before validation.
System Information:
Specmatic version: Tested on Specmatic JS wrapper - 2.0.7 & 1.3.38 was working on 1.3.10.
The text was updated successfully, but these errors were encountered:
Hi @barath121, the spec you have provided here has the "value" and "$ref" keys as siblings.
In such case, the "value" will be ignored as there can be no siblings to "$ref". Refer this documentation for more details.
If we go by the spec snippet you have shared, we will never see the error message that you have reported.
That said, I was able to reproduce the issue by indenting the "$ref" key such that it is the child of the value. e.g.
value:
$ref: SomeSchema
As per OpenAPI, this setup will not resolve the $ref, but will consider it as a key within some object with its value being "SomeSchema".
I am guessing you must have faced the issue that you've reported due to such a setup.
Can you please check this and get back to us?
You can also refer to this documentation which explains how examples can be reused using $ref.
Description
Specmatic Not resolving $ref examples.
Steps to reproduce
Expected behavior
Should resolve ref before validation.
System Information:
The text was updated successfully, but these errors were encountered: