Created
July 13, 2020 06:48
-
-
Save karlosmid/051fe628b35273bfe07631a3183a61b8 to your computer and use it in GitHub Desktop.
Phoenix Swagger validation in production
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def start(_type, _args) do | |
if Application.fetch_env!(:your_app_name, :production) do | |
PhoenixSwagger.Validator.parse_swagger_schema( | |
Path.join(["#{:code.priv_dir(:your_app_name)}", "static", "swagger.json"]) | |
) | |
else | |
PhoenixSwagger.Validator.parse_swagger_schema("priv/static/swagger.json") | |
end | |
// ... rest of your Phoenix Application start up code. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment