Open mrtj opened 6 years ago
It hadn't really come up yet, but perhaps there is no time like the present. Could you perhaps provide a bit more insight into what you are trying to do and a sample repro schema? Thanks!
I am trying to model a (subset) of Facebook Graph API, and for example for the entity "comment" I came up the following json schema (simplified here but stil reproduces the bug):
{
"title": "Comment entity",
"description": "This entity represents a comment.",
"id": "http://schema.neosperience.com/facebook-services/comment",
"type": "object",
"definitions": {
"identity": {
"$ref": "/comment#/definitions/id"
},
"id": {
"type": "string",
"description": "The identifier of the comment."
},
"message": {
"type": "string",
"description": "The comment text."
},
"comments": {
"description": "Comments made on this comment.",
"type": "array",
"items": {
"$ref": "/comment"
}
}
},
"properties": {
"id": {
"$ref": "/comment#/definitions/id"
},
"comments": {
"$ref": "/comment#/definitions/comments"
},
"message": {
"$ref": "/comment#/definitions/message"
}
},
"links": []
}
I guess the problem is the recursive / circular reference made from the comments
field to the comment itself. However this is a valid json schema and it has practical use as well.
The combine
and the verify
commands pass, I get the error when trying to generate the documentation with
prmd doc generated/schema.json > generated/schema.md
I am working with a schema that has recursive references (eg. comments on comments) and the document generator fails with the following error:
Is there any support planned for recursive schemas?