def serialize(self):
api_metadata = OrderedDict()<EOL>api_metadata['<STR_LIT>'] = self.current_version<EOL>locations = {}<EOL>for svc_name, group in self.groups():<EOL><INDENT>group_apis = OrderedDict()<EOL>group_metadata = OrderedDict()<EOL>group_metadata['<STR_LIT>'] = group_apis<EOL>group_metadata['<STR_LIT:title>'] = group.title<EOL>api_metadata[group.name] = group_metadata<EOL>if group.docs is not None:<EOL><INDENT>group_metadata['<STR_LIT>'] = group.docs<EOL><DEDENT>for name, api in group.items():<EOL><INDENT>group_apis[name] = OrderedDict()<EOL>group_apis[name]['<STR_LIT>'] = svc_name<EOL>group_apis[name]['<STR_LIT>'] = group.name<EOL>group_apis[name]['<STR_LIT>'] = api.name<EOL>group_apis[name]['<STR_LIT>'] = api.introduced_at<EOL>group_apis[name]['<STR_LIT>'] = api.methods<EOL>group_apis[name]['<STR_LIT>'] = api.request_schema<EOL>group_apis[name]['<STR_LIT>'] = api.response_schema<EOL>group_apis[name]['<STR_LIT>'] = api.docs<EOL>group_apis[name]['<STR_LIT>'] = api._changelog<EOL>if api.title:<EOL><INDENT>group_apis[name]['<STR_LIT:title>'] = api.title<EOL><DEDENT>else:<EOL><INDENT>title = name.replace('<STR_LIT:->', '<STR_LIT:U+0020>').replace('<STR_LIT:_>', '<STR_LIT:U+0020>').title()<EOL>group_apis[name]['<STR_LIT:title>'] = title<EOL><DEDENT>group_apis[name]['<STR_LIT:url>'] = api.resolve_url()<EOL>if api.undocumented:<EOL><INDENT>group_apis[name]['<STR_LIT>'] = True<EOL><DEDENT>if api.deprecated_at is not None:<EOL><INDENT>group_apis[name]['<STR_LIT>'] = api.deprecated_at<EOL><DEDENT>locations[name] = {<EOL>'<STR_LIT>': api.location,<EOL>'<STR_LIT>': api._request_schema_location,<EOL>'<STR_LIT>': api._response_schema_location,<EOL>'<STR_LIT>': api._changelog_locations,<EOL>'<STR_LIT>': api.view_fn_location,<EOL>}<EOL><DEDENT><DEDENT>return api_metadata, locations<EOL>
Serialize into JSONable dict, and associated locations data.