def raml_url_patterns(raml_filepath, function_map):
"""
creates url patterns that match the endpoints in the raml file, so can be quickly inserted into django urls.
Note these
:param raml_filepath: the path to the raml file (not a file pointer)
:param function_map: a dictionary of urls to functions for mapping
:return:
"""
tree = pyraml.parser.load(raml_filepath)
resource_map = _get_resource_for_tree(tree)
patterns = _generate_patterns(resource_map, function_map)
return patterns
评论列表
文章目录