Skip to content

Commit

Permalink
Format code with mix format (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
zorbash authored May 11, 2022
1 parent 254a81e commit 1766b7a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions lib/mix/tasks/openapi.spec.json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ defmodule Mix.Tasks.Openapi.Spec.Json do
json_encoder = OpenApiSpex.OpenApi.json_encoder()
spec = spec.spec()

json_encoding_result = spec
|> OpenApiSpex.OpenApi.to_map(vendor_extensions: vendor_extensions)
|> json_encoder.encode(pretty: pretty)
json_encoding_result =
spec
|> OpenApiSpex.OpenApi.to_map(vendor_extensions: vendor_extensions)
|> json_encoder.encode(pretty: pretty)

case json_encoding_result do
{:ok, json} ->
Expand All @@ -71,7 +72,10 @@ defmodule Mix.Tasks.Openapi.Spec.Json do
end

defp parse_options(argv) do
parse_options = [strict: [spec: :string, endpoint: :string, pretty: :boolean, vendor_extensions: :boolean]]
parse_options = [
strict: [spec: :string, endpoint: :string, pretty: :boolean, vendor_extensions: :boolean]
]

{opts, args, _} = OptionParser.parse(argv, parse_options)

%Options{
Expand Down
2 changes: 1 addition & 1 deletion lib/open_api_spex/open_api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ defmodule OpenApiSpex.OpenApi do
defimpl encoder do
def encode(api_spec = %OpenApi{}, options) do
api_spec
|> OpenApi.to_map
|> OpenApi.to_map()
|> unquote(encoder).encode(options)
end
end
Expand Down

0 comments on commit 1766b7a

Please sign in to comment.