INNER CODE UNIT · Python

swagger_json_endpoint

fescobar/allure-docker-service · allure-docker-api/app.py:704

def swagger_json_endpoint():
    try:
        specification_file = 'swagger.json'
        if ENABLE_SECURITY_LOGIN:
            specification_file = 'swagger_security.json'

        if URL_PREFIX:
            spec = get_file_as_string("{}/swagger/{}".format(STATIC_CONTENT, specification_file))
            spec_json = eval(spec) #pylint: disable=eval-used
            server_url = spec_json['servers'][0]['url']
            spec_json['servers'][0]['url'] = '{}{}'.format(URL_PREFIX, server_url)
            return jsonify(spec_json)

        return send_file("{}/swagger/{}"
                         .format(STATIC_CONTENT, specification_file), mimetype='application/json')
    except Exception as ex:
        body = {
            'meta_data': {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…