def _return_metadata():
    """
    Return JSON-formatted metadata for route attachment.
    Requires flask.current_app to be set, which means
     `with app.app_context()`
    """
    app = current_app
    retdict = {"auth": app.config["AUTH"]["type"]}
    for fld in ["name", "repository", "version", "description",
                "api_version"]:
        retdict[fld] = app.config[fld.upper()]
    return jsonify(retdict)