Closed RobertCraigie closed 1 year ago
@RobertCraigie the spec you provided is invalid. $ref
cannot have any other sibling properties. When you remove the invalid nullable: true
from the spec you provided, Prism correctly mocks the response.
To represent the child property either being the return
schema or null, you would need to use a oneOf
.
Context
Given this OpenAPI spec which contains a circular schema definition:
Current Behavior
Prism responds with
Expected Behavior
It should instead respond with
Possible Workaround/Solution
Explicitly setting an
example
for thechild
property tonull
Steps to Reproduce
curl -sXGET http://127.0.0.1:4010/pet
Environment
4.14.1