Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#79] missing spec added #81

Merged
merged 3 commits into from
Mar 10, 2017
Merged

[#79] missing spec added #81

merged 3 commits into from
Mar 10, 2017

Conversation

ferigis
Copy link
Member

@ferigis ferigis commented Mar 10, 2017

[close #79]

JsonTypes = [ [<<"binary">>, <<"binary">>, <<"binary">>]
, [1, 2, 3, 4, 5]
, [#{a => 1}, #{b => 2}]
, [<<"mixed">>, <<"list">>, 3, #{a => []}]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add some floats and atoms


-spec types(sr_test_utils:config()) -> {comment, string()}.
types(_Config) ->
JsonTypes = [ [<<"binary">>, <<"binary">>, <<"binary">>]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend to add a nested/complex structure, like:

-spec types(sr_test_utils:config()) -> {comment, string()}.
types(_Config) ->
   Nested = #{a => #{b => [1, #{c => 3}]}},
  JsonTypes = [ [<<"binary">>, <<"binary">>, <<"binary">>]
              , [1, 2, 3, 4, 5]
              , [#{a => 1}, #{b => 2}]
              , Nested
              , [Nested, <<"mixed">>, <<"list">>, 3, #{a => []}]
              ],
  _ = [sr_json:encode(Json) || Json <- JsonTypes],

  {comment, ""}.

@elbrujohalcon elbrujohalcon reopened this Mar 10, 2017
@cabol cabol merged commit aa16b64 into master Mar 10, 2017
@elbrujohalcon elbrujohalcon deleted the ferigis.79.missing_spec branch May 15, 2018 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing option in type spec sr_json: json()
3 participants