File tree Expand file tree Collapse file tree 3 files changed +6
-20
lines changed Expand file tree Collapse file tree 3 files changed +6
-20
lines changed Original file line number Diff line number Diff line change @@ -27,19 +27,15 @@ defmodule JS2E.Parser.ArrayParser do
2727 iex> type?(%{})
2828 false
2929
30- iex> type?(%{"type" => "array"})
31- false
32-
33- iex> type?(%{"type" => "array", "items" => %{"$ref" => "#foo"}})
30+ iex> type?(%{"items" => %{"$ref" => "#foo"}})
3431 true
3532
3633 """
3734 @ impl JS2E.Parser.ParserBehaviour
3835 @ spec type? ( Types . schemaNode ( ) ) :: boolean
3936 def type? ( schema_node ) do
40- type = schema_node [ "type" ]
4137 items = schema_node [ "items" ]
42- type == "array" && is_map ( items )
38+ is_map ( items )
4339 end
4440
4541 @ doc ~S"""
Original file line number Diff line number Diff line change @@ -35,21 +35,16 @@ defmodule JS2E.Parser.ObjectParser do
3535 iex> type?(%{})
3636 false
3737
38- iex> type?(%{"type" => "object"})
39- false
40-
41- iex> an_object = %{"type" => "object",
42- ...> "properties" => %{"name" => %{"type" => "string"}}}
38+ iex> an_object = %{"properties" => %{"name" => %{"type" => "string"}}}
4339 iex> type?(an_object)
4440 true
4541
4642 """
4743 @ impl JS2E.Parser.ParserBehaviour
4844 @ spec type? ( map ) :: boolean
4945 def type? ( schema_node ) do
50- type = schema_node [ "type" ]
5146 properties = schema_node [ "properties" ]
52- type == "object" && is_map ( properties )
47+ is_map ( properties )
5348 end
5449
5550 @ doc ~S"""
Original file line number Diff line number Diff line change @@ -28,21 +28,16 @@ defmodule JS2E.Parser.TupleParser do
2828 iex> type?(%{})
2929 false
3030
31- iex> type?(%{"type" => "array"})
32- false
33-
34- iex> aTuple = %{"type" => "array",
35- ...> "items" => [%{"$ref" => "#foo"}, %{"$ref" => "#bar"}]}
31+ iex> aTuple = %{"items" => [%{"$ref" => "#foo"}, %{"$ref" => "#bar"}]}
3632 iex> type?(aTuple)
3733 true
3834
3935 """
4036 @ impl JS2E.Parser.ParserBehaviour
4137 @ spec type? ( Types . node ( ) ) :: boolean
4238 def type? ( schema_node ) do
43- type = schema_node [ "type" ]
4439 items = schema_node [ "items" ]
45- type == "array" && is_list ( items )
40+ is_list ( items )
4641 end
4742
4843 @ doc ~S"""
You can’t perform that action at this time.
0 commit comments