Closed
Description
Consider this simple YAML:
openapi: 3.0.2
info:
title: 'City API'
version: dev
paths:
'/city':
get:
description: 'Get City'
responses:
'200':
description: 'success'
content:
application/json:
schema:
$ref: '#/components/schemas/City'
components:
schemas:
City:
$ref: '#/components/schemas/Named'
Named:
type: string
(new League\OpenAPIValidation\PSR7\ValidatorBuilder)
->fromYaml($yaml)
->getResponseValidator();
Response schema references "City" schema, which itself references "Named" schema, which is perfectly valid. However, the library throws the following exception:
cebe\openapi\exceptions\UnresolvableReferenceException : Cyclic reference detected, setReferenceContext() called on a Reference Object.