Browse Source

fix: non_neg_integer() translated to minimum = 1 in bridge-api-en.json

The schema type non_neg_integer() should be translated to minimum 0 and
not 1 when generating the bridge-api-en.json file.

Fixes:
https://emqx.atlassian.net/browse/EMQX-9714
Kjell Winblad 2 years ago
parent
commit
a711ee21f3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      apps/emqx_conf/src/emqx_conf.erl

+ 1 - 1
apps/emqx_conf/src/emqx_conf.erl

@@ -311,7 +311,7 @@ typename_to_spec("float()", _Mod) ->
 typename_to_spec("integer()", _Mod) ->
     #{type => number};
 typename_to_spec("non_neg_integer()", _Mod) ->
-    #{type => number, minimum => 1};
+    #{type => number, minimum => 0};
 typename_to_spec("number()", _Mod) ->
     #{type => number};
 typename_to_spec("string()", _Mod) ->