Skip to content

Commit

Permalink
Merge pull request #89 from sile/fix-encode-doc
Browse files Browse the repository at this point in the history
Fix the documentation for `jsone:encode()` and `jsone:try_encode()` to reflect their latest behavior.
  • Loading branch information
sile authored Nov 26, 2024
2 parents 331b4a7 + f7b4101 commit 0b3a586
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jsone.erl
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ encode(JsonValue) ->
%% > jsone:encode([1, null, 2]).
%% <<"[1,null,2]">>
%%
%% > jsone:encode([1, self(), 2]). % A pid is not a json value
%% > jsone:encode([1, self(), 2], [{map_unknown_value, undefined}]). % PID is not a json value
%% ** exception error: bad argument
%% in function jsone_encode:value/3
%% called as jsone_encode:value(<0,34,0>,[{array_values,[2]}],<<"[1,">>)
Expand Down Expand Up @@ -414,7 +414,7 @@ try_encode(JsonValue) ->
%% > jsone:try_encode([1, null, 2]).
%% {ok,<<"[1,null,2]">>}
%%
%% > jsone:try_encode([1, hoge, 2]). % 'hoge' atom is not a json value
%% > jsone:try_encode([1, self(), 2], [{map_unknown_value, undefined}]). % PID is not a json value
%% {error,{badarg,[{jsone_encode,value,
%% [hoge,[{array_values,[2]}],<<"[1,">>],
%% [{line,86}]}]}}
Expand Down

0 comments on commit 0b3a586

Please sign in to comment.