From 2a48b12ed5c0271d4fb8ff5c8371ed04563dd47a Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Tue, 27 Feb 2024 16:12:08 -0300 Subject: [PATCH] fix(typespec): fix `hocon_schema:override` typespec We commonly use `deprecated => {since, "x.y.z"}`, but that is not what the typespec expects. ``` Line 72 Column 50: The call hocon_schema:override(Sc::atom() | fun((_) -> any()) | maybe_improper_list() | tuple() | map(), Override::#{'default':=[], 'deprecated':={'since',[46 | 48 | 53 | 54 | 101,...]}, 'importance':='hidden', 'required':='false', 'type':=_, 'validator':=fun((_) -> 'ok')}) breaks the contract (field_schema(), field_schema_map()) -> field_schema_fun() ``` --- src/hocon_schema.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hocon_schema.erl b/src/hocon_schema.erl index 8f5004a..b61ca13 100644 --- a/src/hocon_schema.erl +++ b/src/hocon_schema.erl @@ -132,7 +132,7 @@ %% deprecated field can not be removed due to compatibility reasons. %% The value will be dropped, %% Deprecated fields are treated as required => {false, recursively} - deprecated => {since, binary()} | false, + deprecated => {since, binary() | string()} | false, %% Other names to reference this field. %% this can be useful when we need to rename some filed names %% while keeping backward compatibility.