Using the following code I end up with circular references in the poduced schea where both Children and Child reference themselves and provide no further information about their schema.
class Children(jsl.Document):
children = jsl.OneOfField([
jsl.DocumentField("Top", as_ref=True),
jsl.DocumentField("Child", as_ref=True),
])
class Base(jsl.Document):
mid = jsl.StringField(required=True)
derivedFrom = jsl.DocumentField("Children", as_ref=True)
class Child(Base):
abc = jsl.StringField(required=True)
class Top(Base):
model = jsl.StringField(required=True)
test = """
{
"mid": "a",
"model": "a",
"derivedFrom": {
"children": {
"mid": "b",
"abc": "def"
}
}
}
"""
print Top.get_schema(ordered=True)
Using the following code I end up with circular references in the poduced schea where both Children and Child reference themselves and provide no further information about their schema.
produces