aiohttp-swagger
                                
                                 aiohttp-swagger copied to clipboard
                                
                                    aiohttp-swagger copied to clipboard
                            
                            
                            
                        Add SWAGGER_VALIDATOR_URL variable in the swagger_ui/index.html
In order to be able to switch off swagger doc validation or change default URL by custom one SWAGGER_VALIDATOR_URL variable should be introduced in aiohttp_swagger/swagger_ui/index.html and supported in aiohttp_swagger/__init__.py by new argument of setup_swagger function (i.e. swagger_validator_url: str = '//online.swagger.io/validator').
aiohttp_swagger/__init__.py:
    with open(join(STATIC_PATH, "index.html"), "r") as f:
        app["SWAGGER_TEMPLATE_CONTENT"] = (
            f.read()
            .replace("##SWAGGER_CONFIG##", '/{}{}'.
                     format(api_base_url.lstrip('/'), _swagger_def_url))
            .replace("##STATIC_PATH##", '/{}{}'.
                     format(api_base_url.lstrip('/'), statics_path))
            .replace("##SWAGGER_VALIDATOR_URL##", swagger_validator_url)
        )
aiohttp_swagger/swagger_ui/index.html:
      window.swaggerUi = new SwaggerUi({
        url: url,
        validatorUrl: "##SWAGGER_VALIDATOR_URL##" || null,