mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 12:37:49 +00:00
fix for resolving looping relative references
In vacuum, a usecase was reported where an infinite loop occurred due to re-parsing the same reference over and over in a loop. It was re-creatable and it was because the loop happened before the index was ready. This should be resolved now, at least for this use case. To be sure, I have included the specs as a new test. https://github.com/daveshanley/vacuum/issues/268 Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
33
test_specs/first.yaml
Normal file
33
test_specs/first.yaml
Normal file
@@ -0,0 +1,33 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
title: title
|
||||
description: description
|
||||
version: 0.0.0
|
||||
|
||||
paths:
|
||||
|
||||
/items:
|
||||
get:
|
||||
tags:
|
||||
- items
|
||||
summary: summary
|
||||
description: description
|
||||
parameters: []
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
title: Schema
|
||||
description: description
|
||||
type: object
|
||||
|
||||
additionalProperties:
|
||||
type: object
|
||||
title: first title
|
||||
description: first description
|
||||
additionalProperties: false
|
||||
properties:
|
||||
second:
|
||||
$ref: "second.yaml"
|
||||
31
test_specs/second.yaml
Normal file
31
test_specs/second.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
title: second doc title
|
||||
description: second doc description
|
||||
type: object
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
properties:
|
||||
|
||||
property1:
|
||||
title: title
|
||||
description: property 1 description
|
||||
type: array
|
||||
items:
|
||||
title: item
|
||||
description: third description
|
||||
type: object
|
||||
additionalProperties: false
|
||||
properties:
|
||||
details:
|
||||
$ref: "third.yaml"
|
||||
|
||||
property2:
|
||||
title: title
|
||||
description: property 2 description
|
||||
type: object
|
||||
additionalProperties: false
|
||||
properties:
|
||||
property:
|
||||
title: title
|
||||
description: tasty description
|
||||
type: integer
|
||||
15
test_specs/third.yaml
Normal file
15
test_specs/third.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
title: third doc title
|
||||
description: third doc description
|
||||
type: object
|
||||
|
||||
additionalProperties: false
|
||||
maxProperties: 1
|
||||
|
||||
properties:
|
||||
|
||||
property:
|
||||
title: title of third prop in third doc
|
||||
type: object
|
||||
properties:
|
||||
statistics:
|
||||
$ref: 'second.yaml#/properties/property2'
|
||||
Reference in New Issue
Block a user