def resolve_schema_references(schema, refs=None):
'''Resolves and replaces json-schema $refs with the appropriate dict.
Recursively walks the given schema dict, converting every instance
of $ref in a 'properties' structure with a resolved dict.
This modifies the input schema and also returns it.
Arguments:
schema:
the schema dict
refs:
a dict of <string, dict> which forms a store of referenced schemata
Returns:
schema
'''
refs = refs or {}
return _resolve_schema_references(schema, RefResolver("", schema, store=refs))
评论列表
文章目录