Skip to content

Commit

Permalink
Merge pull request #77 from Frameio/develop
Browse files Browse the repository at this point in the history
Release v0.10.1
  • Loading branch information
bceskavich authored Apr 14, 2020
2 parents a4e9333 + 0e81452 commit 1396c5a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 6 additions & 1 deletion lib/rolodex/processors/open_api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,18 @@ defmodule Rolodex.Processors.OpenAPI do
|> process_content_body_headers(rest)
end

defp process_content_body_ref_data(%{schema: schema, examples: examples}) do
defp process_content_body_ref_data(%{schema: schema, examples: examples})
when map_size(examples) > 0 do
%{
schema: process_schema_field(schema),
examples: process_content_body_examples(examples)
}
end

defp process_content_body_ref_data(%{schema: schema}) do
%{schema: process_schema_field(schema)}
end

defp process_content_body_examples(examples),
do: Map.new(examples, fn {name, example} -> {name, %{value: example}} end)

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Rolodex.MixProject do
app: :rolodex,
name: "Rolodex",
description: "Automated docs generation",
version: "0.10.0",
version: "0.10.1",
elixir: "~> 1.7",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand Down
4 changes: 0 additions & 4 deletions test/rolodex_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ defmodule RolodexTest do
"ErrorResponse" => %{
"content" => %{
"application/json" => %{
"examples" => %{},
"schema" => %{
"properties" => %{
"message" => %{"type" => "string"},
Expand Down Expand Up @@ -136,13 +135,11 @@ defmodule RolodexTest do
},
"content" => %{
"application/json" => %{
"examples" => %{},
"schema" => %{
"$ref" => "#/components/schemas/User"
}
},
"application/lolsob" => %{
"examples" => %{},
"schema" => %{
"type" => "array",
"items" => %{
Expand Down Expand Up @@ -639,7 +636,6 @@ defmodule RolodexTest do
"ErrorResponse" => %{
"content" => %{
"application/json" => %{
"examples" => %{},
"schema" => %{
"properties" => %{
"message" => %{"type" => "string"},
Expand Down

0 comments on commit 1396c5a

Please sign in to comment.