From a3d12c643b18d47c79dd75cd913328a06130495f Mon Sep 17 00:00:00 2001 From: Chris O'Donnell Date: Sat, 1 Oct 2022 09:06:51 -0400 Subject: [PATCH] Fix `pos?` json schema mapping. --- src/malli/json_schema.cljc | 2 +- test/malli/json_schema_test.cljc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/malli/json_schema.cljc b/src/malli/json_schema.cljc index 131bf976c..9a1d849f8 100644 --- a/src/malli/json_schema.cljc +++ b/src/malli/json_schema.cljc @@ -28,7 +28,7 @@ (defmethod accept 'nat-int? [_ _ _ _] {:type "integer", :minimum 0}) (defmethod accept 'float? [_ _ _ _] {:type "number"}) (defmethod accept 'double? [_ _ _ _] {:type "number"}) -(defmethod accept 'pos? [_ _ _ _] {:type "number" :exclusiveMininum 0}) +(defmethod accept 'pos? [_ _ _ _] {:type "number" :exclusiveMinimum 0}) (defmethod accept 'neg? [_ _ _ _] {:type "number" :exclusiveMaximum 0}) (defmethod accept 'boolean? [_ _ _ _] {:type "boolean"}) (defmethod accept 'string? [_ _ _ _] {:type "string"}) diff --git a/test/malli/json_schema_test.cljc b/test/malli/json_schema_test.cljc index 380838b6c..0e90ed638 100644 --- a/test/malli/json_schema_test.cljc +++ b/test/malli/json_schema_test.cljc @@ -8,6 +8,7 @@ (def expectations [;; predicates [pos-int? {:type "integer", :minimum 1}] + [pos? {:type "number" :exclusiveMinimum 0}] [float? {:type "number"}] ;; comparators [[:> 6] {:type "number", :exclusiveMinimum 6}]