Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows to inject swagger template page #208

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/phoenix_swagger/plug/swaggerui.ex
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ defmodule PhoenixSwagger.Plug.SwaggerUI do
def init(opts) do
app = Keyword.fetch!(opts, :otp_app)
swagger_file = Keyword.fetch!(opts, :swagger_file)
body = EEx.eval_string(@template, spec_url: swagger_file)
template = Keyword.get(opts, :template, @template)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. Please update the Options section of the doc string to include template.

body = EEx.eval_string(template, spec_url: swagger_file)
swagger_file_path = Path.join(["priv", "static", swagger_file])
[app: app, body: body, spec_url: swagger_file, swagger_file_path: swagger_file_path]
end
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule PhoenixSwagger.Mixfile do
use Mix.Project

@version "0.8.1"
@version "0.8.2"

def project do
[
Expand Down