Skip to content

Commit

Permalink
options を消す
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Nov 19, 2024
1 parent 6a60245 commit 98158fb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/jesse_cli.erl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jesse_run(JsonInstance, Schema, Schemata) ->
{ok, _} = application:ensure_all_started(jesse),
ok = add_schemata(Schemata),
{ok, JsonInstanceBinary} = file:read_file(JsonInstance),
JsonInstanceJsx = jsone:decode(JsonInstanceBinary, [{object_format, proplist}]),
JsonInstanceJsx = jsone:decode(JsonInstanceBinary),
jesse:validate(Schema,
JsonInstanceJsx).

Expand All @@ -102,7 +102,7 @@ add_schemata([]) ->
ok;
add_schemata([SchemaFile | Rest]) ->
{ok, SchemaBin} = file:read_file(SchemaFile),
Schema0 = jsone:decode(SchemaBin, [{object_format, proplist}]),
Schema0 = jsone:decode(SchemaBin),
Schema = maybe_fill_schema_id(SchemaFile, Schema0),
ok = jesse:add_schema(SchemaFile, Schema),
add_schemata(Rest).
Expand Down
4 changes: 2 additions & 2 deletions src/jesse_database.erl
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ add_file_uri(Key0) ->
"file://" ++ File = Key,
{ok, SchemaBin} = file:read_file(File),
{ok, #file_info{mtime = Mtime}} = file:read_file_info(File),
Schema = jsone:decode(SchemaBin, [{object_format, proplist}]),
Schema = jsone:decode(SchemaBin),
SchemaInfos = [{Key, Mtime, Schema}],
ValidationFun = fun jesse_lib:is_json_object/1,
store_schemas(SchemaInfos, ValidationFun).
Expand All @@ -321,7 +321,7 @@ add_http_uri(Key0) ->
Key = jesse_state:canonical_path(Key0, Key0),
{ok, Response} = httpc:request(get, {Key, []}, [], [{body_format, binary}]),
{{_Line, 200, _}, Headers, SchemaBin} = Response,
Schema = jsone:decode(SchemaBin, [{object_format, proplist}]),
Schema = jsone:decode(SchemaBin),
SchemaInfos = [{Key, get_http_mtime(Headers), Schema}],
ValidationFun = fun jesse_lib:is_json_object/1,
store_schemas(SchemaInfos, ValidationFun).
Expand Down
2 changes: 1 addition & 1 deletion src/jesse_error.erl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ handle_schema_invalid(Info, State) ->

-spec to_json(Error :: error()) -> binary().
to_json(Error) ->
to_json(Error, [{indent, 2}, {space, 1}]).
to_json(Error, []).


-spec to_json(Error :: error(), JsoneOptions :: [jsone:encode_option()]) -> binary().
Expand Down
4 changes: 2 additions & 2 deletions src/jesse_tests_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ get_tests(RelativeTestsDir, DefaultSchema, Config) ->
TestFiles = filelib:wildcard(TestsDir ++ "/*.json"),
lists:map(fun(TestFile) ->
{ok, Bin} = file:read_file(TestFile),
Tests = jsone:decode(Bin, [{object_format, proplist}]),
Tests = jsone:decode(Bin),
Key = testfile_to_key(TestFile),
CaseConfig = {Tests, DefaultSchema},
{Key, CaseConfig}
Expand Down Expand Up @@ -142,4 +142,4 @@ get_path(Key, Schema) ->
load_schema(URI) ->
{ok, Response} = httpc:request(get, {URI, []}, [], [{body_format, binary}]),
{{_Line, 200, _}, _Headers, Body} = Response,
jsone:decode(Body, [{object_format, proplist}]).
jsone:decode(Body).

0 comments on commit 98158fb

Please sign in to comment.