From 42d78769d7dd495df8a47afa940a16150a8c9f7e Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Fri, 11 Mar 2022 22:58:55 +0800 Subject: [PATCH] Fix typos --- CHANGELOG.md | 2 +- README.md | 4 ++-- src/jesse.erl | 4 ++-- src/jesse_error.erl | 2 +- src/jesse_lib.erl | 2 +- test/Emakefile | 2 +- test/jesse_schema_validator_tests.erl | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f11464e..28b1fdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -84,7 +84,7 @@ * Big refactoring * Start to respect $schema -* Add posibility of adding validators for different schemas +* Add possibility of adding validators for different schemas ## 1.0.0 diff --git a/README.md b/README.md index 21cd5b8..2b291de 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,7 @@ Let's now change the value of the field "a" to a boolean [<<"a">>]}]} ``` -we stil got only two errors. +we still got only two errors. Let's try using 'infinity' as the argument for the `allowed_errors` option @@ -258,7 +258,7 @@ Value, Path}` where * Schema is the part of the schema where validation failed * ErrorType is the type of error, usually an atom such as `wrong_type`, `not_in_range` or `no_match` -* Value is The part of the value where failed validation agains Schema +* Value is The part of the value where failed validation against Schema * Path is a path to where validation failed within the original value. The path is a list of property names and zero-based array indices referencing the properties and array items within a JSON document; e.g. in the JSON document diff --git a/src/jesse.erl b/src/jesse.erl index 0bda4f5..4b6f273 100644 --- a/src/jesse.erl +++ b/src/jesse.erl @@ -122,7 +122,7 @@ add_schema(Key, Schema) -> jesse_database:add(Key, Schema, ValidationFun). %% @doc Equivalent to `add_schema/2', but `Schema' is a binary string, and -%% the third agument is a parse function to convert the binary string to +%% the third argument is a parse function to convert the binary string to %% a supported internal representation of json. -spec add_schema( Key :: string() , Schema :: binary() @@ -224,7 +224,7 @@ validate(Schema, Data, Options) -> validate_with_schema(Schema, Data) -> validate_with_schema(Schema, Data, []). -%% @doc Validates json `Data' agains the given schema `Schema', using `Options'. +%% @doc Validates json `Data' against the given schema `Schema', using `Options'. %% If the given json is valid, then it is returned to the caller, otherwise %% an error with an appropriate error reason is returned. If the `parser_fun' %% option is provided, then both `Schema' and `Data' are considered to be a diff --git a/src/jesse_error.erl b/src/jesse_error.erl index 14daf2b..32c12a8 100644 --- a/src/jesse_error.erl +++ b/src/jesse_error.erl @@ -64,7 +64,7 @@ %% @doc Implements the default error handler. %% If the length of `ErrorList' exceeds `AllowedErrors' then the function -%% throws an exeption, otherwise adds a new element to the list and returs it. +%% throws an exception, otherwise adds a new element to the list and returns it. -spec default_error_handler( Error :: error_reason() , ErrorList :: [error_reason()] , AllowedErrors :: jesse:allowed_errors() diff --git a/src/jesse_lib.erl b/src/jesse_lib.erl index f38cba0..7f99f5f 100644 --- a/src/jesse_lib.erl +++ b/src/jesse_lib.erl @@ -115,7 +115,7 @@ re_options() -> %% will be no differences between objects that contain one of those %% lists with the same elements but in different order. Lists for %% which order is relevant, e.g. JSON arrays, keep their original -%% order and will be considered diffferent if the order is different. +%% order and will be considered different if the order is different. -spec normalize_and_sort(Value :: any()) -> any(). normalize_and_sort(Value) -> normalize_and_sort_check_object(Value). diff --git a/test/Emakefile b/test/Emakefile index b6166b6..667eb2a 100644 --- a/test/Emakefile +++ b/test/Emakefile @@ -1,5 +1,5 @@ %% This Emakefile is called by common test during `rebar ct` -%% and it defines 'COMMON_TEST' macro to conditionaly compile +%% and it defines 'COMMON_TEST' macro to conditionally compile %% module, which uses maps syntax. %% This one required because common test doesn't respect rebar's %% `platform_define` option. diff --git a/test/jesse_schema_validator_tests.erl b/test/jesse_schema_validator_tests.erl index 4352d0d..9f57190 100644 --- a/test/jesse_schema_validator_tests.erl +++ b/test/jesse_schema_validator_tests.erl @@ -408,7 +408,7 @@ map_data_test_draft(URI) -> }, %% XXX: order of errors isn't guaranteed %% In case of future fails it can be replaced with manual catching and sorting - %% of throwed error list, then checked using ?assertMatch + %% of thrown error list, then checked using ?assertMatch ?assertThrow([ { data_invalid , {[{<<"type">>, <<"object">>} | _ ]} , wrong_type