xerions / phoenix_swagger

Swagger integration to Phoenix framework
Mozilla Public License 2.0
691 stars 181 forks source link

Customize Swagger UI Validator URL #252

Closed greg-rychlewski closed 4 years ago

greg-rychlewski commented 4 years ago

Would like to be able to specify a custom swagger ui validation url/disable validation altogether.

Created a pull request for your review.

mbuhot commented 4 years ago

Thanks @greg-rychlewski.

Rather than supplying the validatorUrl as a single plug option, what if we were to support the configUrl, which allows swagger-ui to fetch a JSON file?

You could add the file in priv/static/swagger_ui_config.json, then configure most of swagger-ui that way. Alternatively users could create a Controller action to serve the swagger-ui config dynamically if necessary.

greg-rychlewski commented 4 years ago

Thanks @mbuhot that's a really good idea.

I updated my pull request based on your suggestion.