Skip to content

Commit

Permalink
Add support for type
Browse files Browse the repository at this point in the history
  • Loading branch information
loucash committed Nov 29, 2013
1 parent 280fa21 commit 1bfee82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/josser_custom_types.erl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ validate(TypeDesc, CustomTypes) ->
-spec validate_simple_type(binary() | null) -> boolean().
validate_simple_type(<<"object">>) -> true;
validate_simple_type(<<"array">>) -> true;
validate_simple_type(<<"any">>) -> true;
validate_simple_type(<<"string">>) -> true;
validate_simple_type(<<"integer">>) -> true;
validate_simple_type(<<"number">>) -> true;
Expand Down
8 changes: 8 additions & 0 deletions test/josser_metadata_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ t_simple_json_types(_Config) ->
{<<"properties">>,
[{<<"key">>,[{<<"type">>,<<"integer">>}]}]}]
},
{
[{<<"key">>, <<"{\"type\": \"any\"}">>}],

[?DEFAULT_SCHEMA,
{<<"type">>, <<"object">>},
{<<"properties">>,
[{<<"key">>,[{<<"type">>,<<"any">>}]}]}]
},
{
[{<<"key">>, <<"{\"type\": \"string\"}">>}],

Expand Down

0 comments on commit 1bfee82

Please sign in to comment.