Skip to content

Commit

Permalink
Update version, remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pinx committed Oct 18, 2016
1 parent 7c94121 commit 673bbf3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 30 deletions.
24 changes: 7 additions & 17 deletions lib/mix/tasks/swagger.ex
Original file line number Diff line number Diff line change
Expand Up @@ -141,25 +141,15 @@ defmodule Mix.Tasks.Swagger do
parse_default_verb(route.path)
end

response_schema = verb[:response_schema]
verb = Map.delete(verb, :response_schema)

verb_string = String.downcase("#{route.verb}")
if verb[:responses] == nil do
verb = Map.put(verb, :responses, default_responses(verb_string, response_schema))
end

if verb[:produces] == nil do
verb = Map.put(verb, :produces, Application.get_env(:swaggerdoc, :produces, []))
end

if verb[:operationId] == nil do
verb = Map.put(verb, :operationId, "#{route.opts}")
end

if verb[:description] == nil do
verb = Map.put(verb, :description, "")
end
response_schema = verb[:response_schema]
verb = verb
|> Map.delete(:response_schema)
|> Map.put(:responses, verb[:responses] || default_responses(verb_string, response_schema))
|> Map.put(:produces, verb[:produces] || Application.get_env(:swaggerdoc, :produces, []))
|> Map.put(:operationId, verb[:operationId] || "#{route.opts}")
|> Map.put(:description, verb[:description] || "")

path = Map.put(path, verb_string, verb)
paths = Map.put(swagger[:paths], swagger_path, path)
Expand Down
8 changes: 4 additions & 4 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ defmodule SwaggerDoc.Mixfile do
# Type `mix help deps` for more examples and options
defp deps do
[
{:phoenix, ">= 1.0.0"},
{:ecto, ">= 1.0.0"},
{:poison, "~> 1.5.0"},
{:phoenix, "~> 1.2"},
{:ecto, "~> 2.0"},
{:poison, "~> 2.0"},
{:ex_doc, "~> 0.8.4", only: :docs},
{:earmark, "~> 0.1.17", only: :docs},
{:meck, "~> 0.8.3", only: :test},
Expand All @@ -64,5 +64,5 @@ defmodule SwaggerDoc.Mixfile do
files: ~w(lib) ++
~w(LICENSE mix.exs README.md)
]
end
end
end
20 changes: 11 additions & 9 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
%{"decimal": {:hex, :decimal, "1.1.0"},
"earmark": {:hex, :earmark, "0.1.17"},
"ecto": {:hex, :ecto, "1.0.7"},
"ex_doc": {:hex, :ex_doc, "0.8.4"},
"meck": {:hex, :meck, "0.8.3"},
"phoenix": {:hex, :phoenix, "1.0.1"},
"plug": {:hex, :plug, "1.0.0"},
"poison": {:hex, :poison, "1.5.0"},
"poolboy": {:hex, :poolboy, "1.5.1"}}
%{"decimal": {:hex, :decimal, "1.2.0", "462960fd71af282e570f7b477f6be56bf8968e68277d4d0b641a635269bf4b0d", [:mix], []},
"earmark": {:hex, :earmark, "0.1.17", "a2269e72ff85501bdb58c2de9edc0a9a17a4be2757883eed1f601b30494ed2bf", [:mix], []},
"ecto": {:hex, :ecto, "2.0.5", "7f4c79ac41ffba1a4c032b69d7045489f0069c256de606523c65d9f8188e502d", [:mix], [{:db_connection, "~> 1.0-rc.4", [hex: :db_connection, optional: true]}, {:decimal, "~> 1.1.2 or ~> 1.2", [hex: :decimal, optional: false]}, {:mariaex, "~> 0.7.7", [hex: :mariaex, optional: true]}, {:poison, "~> 1.5 or ~> 2.0", [hex: :poison, optional: true]}, {:poolboy, "~> 1.5", [hex: :poolboy, optional: false]}, {:postgrex, "~> 0.12.0", [hex: :postgrex, optional: true]}, {:sbroker, "~> 1.0-beta", [hex: :sbroker, optional: true]}]},
"ex_doc": {:hex, :ex_doc, "0.8.4", "c74a30b09627ff22a2bb7f75d3b75dec3aedb2bd434bb3009a73a40425c2315d", [:mix], [{:earmark, "~> 0.1.17 or ~> 0.2", [hex: :earmark, optional: true]}]},
"meck": {:hex, :meck, "0.8.3", "4628a1334c69610c5bd558b04dc78d723d8ec5445c123856de34c77f462b5ee5", [:rebar], []},
"mime": {:hex, :mime, "1.0.1", "05c393850524767d13a53627df71beeebb016205eb43bfbd92d14d24ec7a1b51", [:mix], []},
"phoenix": {:hex, :phoenix, "1.2.1", "6dc592249ab73c67575769765b66ad164ad25d83defa3492dc6ae269bd2a68ab", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, optional: true]}, {:phoenix_pubsub, "~> 1.0", [hex: :phoenix_pubsub, optional: false]}, {:plug, "~> 1.1", [hex: :plug, optional: false]}, {:poison, "~> 1.5 or ~> 2.0", [hex: :poison, optional: false]}]},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "1.0.1", "c10ddf6237007c804bf2b8f3c4d5b99009b42eca3a0dfac04ea2d8001186056a", [:mix], []},
"plug": {:hex, :plug, "1.2.2", "cfbda521b54c92ab8ddffb173fbaabed8d8fc94bec07cd9bb58a84c1c501b0bd", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, optional: true]}, {:mime, "~> 1.0", [hex: :mime, optional: false]}]},
"poison": {:hex, :poison, "2.2.0", "4763b69a8a77bd77d26f477d196428b741261a761257ff1cf92753a0d4d24a63", [:mix], []},
"poolboy": {:hex, :poolboy, "1.5.1", "6b46163901cfd0a1b43d692657ed9d7e599853b3b21b95ae5ae0a777cf9b6ca8", [:rebar], []}}

0 comments on commit 673bbf3

Please sign in to comment.