Closed
Description
Syntactically, it seems possible to construct an infinite circular reference using Definitions Objects.
Obviously, such a reference could never actually be called or returned. I can't find any conclusive answer on this in the specs. The editor at http://editor.swagger.io/ seems to accept it as valid syntax, but produces an undefined
Schema.
How should such a situation be treated?
Example
{
"swagger": "2.0",
"info": {
"title": "vanderlee/PHPSwaggerGen",
"version": "2.3.7"
},
"host": "example.com",
"basePath": "\/base",
"paths": {
"\/customers": {
"get": {
"tags": [
"Test"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#\/definitions\/Person"
}
}
}
}
}
},
"definitions": {
"Address": {
"type": "object",
"required": [
"city",
"occupant"
],
"properties": {
"city": {
"type": "string"
},
"occupant": {
"$ref": "#\/definitions\/Person"
}
}
},
"Person": {
"type": "object",
"required": [
"name",
"home"
],
"properties": {
"name": {
"type": "string"
},
"home": {
"$ref": "#\/definitions\/Address"
}
}
}
},
"tags": [
{
"name": "Test"
}
]
}
Metadata
Metadata
Assignees
Labels
No labels