def _populate_route_attributes_helper(self, env, route, schema):
arg_dt = self._resolve_type(env, route._ast_node.arg_type_ref)<EOL>result_dt = self._resolve_type(env, route._ast_node.result_type_ref)<EOL>error_dt = self._resolve_type(env, route._ast_node.error_type_ref)<EOL>ast_deprecated = route._ast_node.deprecated<EOL>if ast_deprecated:<EOL><INDENT>assert ast_deprecated[<NUM_LIT:0>]<EOL>new_route_name = ast_deprecated[<NUM_LIT:1>]<EOL>new_route_version = ast_deprecated[<NUM_LIT:2>]<EOL>if new_route_name:<EOL><INDENT>assert new_route_version<EOL>is_not_defined = False<EOL>is_not_route = False<EOL>if new_route_name in env:<EOL><INDENT>if isinstance(env[new_route_name], ApiRoutesByVersion):<EOL><INDENT>if new_route_version not in env[new_route_name].at_version:<EOL><INDENT>is_not_defined = True<EOL><DEDENT><DEDENT>else:<EOL><INDENT>is_not_route = True<EOL><DEDENT><DEDENT>else:<EOL><INDENT>is_not_defined = True<EOL><DEDENT>if is_not_defined:<EOL><INDENT>raise InvalidSpec(<EOL>'<STR_LIT>' % (<EOL>quote(new_route_name), new_route_version),<EOL>route._ast_node.lineno, route._ast_node.path)<EOL><DEDENT>if is_not_route:<EOL><INDENT>raise InvalidSpec(<EOL>'<STR_LIT>' % quote(new_route_name),<EOL>route._ast_node.lineno, route._ast_node.path)<EOL><DEDENT>new_route = env[new_route_name].at_version[new_route_version]<EOL>deprecated = DeprecationInfo(new_route)<EOL><DEDENT>else:<EOL><INDENT>deprecated = DeprecationInfo()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>deprecated = None<EOL><DEDENT>attr_by_name = {}<EOL>for attr in route._ast_node.attrs:<EOL><INDENT>attr_by_name[attr.name] = attr<EOL><DEDENT>try:<EOL><INDENT>validated_attrs = schema.check_attr_repr(attr_by_name)<EOL><DEDENT>except KeyError as e:<EOL><INDENT>raise InvalidSpec(<EOL>"<STR_LIT>" % e.args[<NUM_LIT:0>],<EOL>route._ast_node.lineno, route._ast_node.path)<EOL><DEDENT>route.set_attributes(<EOL>deprecated=deprecated,<EOL>doc=route._ast_node.doc,<EOL>arg_data_type=arg_dt,<EOL>result_data_type=result_dt,<EOL>error_data_type=error_dt,<EOL>attrs=validated_attrs)<EOL>
Converts a single forward reference of a route into a complete definition.