bee
bee copied to clipboard
OpenAPI circular reference definition
Context
There is an issue of circular dependency into open api definition that doesn't permit to resolve all references.
Summary
In SwarmCommon.yaml there are definitions of LoggerTreeData and LoggerTreeNode with circular dependencies:
LoggerTreeData:
type: object
nullable: true
properties:
/:
$ref: "#/components/schemas/LoggerTreeNode"
+:
type: array
items:
type: string
description: The combination of the logger verbosity and its subsystem separated by |.
example: "warning|one/name[0][]>>824634860360"
LoggerTreeNode:
type: object
additionalProperties:
$ref: "#/components/schemas/LoggerTreeData"
This should be avoided, because doesn't permit to resolve all references with tools like speccy (https://github.com/wework/speccy).
Expected behavior
OpenAPI definition shouldn't contain circular dependencies.
Actual behavior
Execution of speccy tool on current open api definition gives Maximum call stack size exceeded error.
Possible solution
Verify if circular dependency is really required, and try to avoid it if possible.