schema

RAJKUMAR 2024-08-30T21:58:49.086989Z

Hi I've error while executing the below code

ikitommi 2024-08-31T07:58:51.696329Z

Please create an issue to metosin/schema-tools, should be easy to fix over there

RAJKUMAR 2024-08-31T17:49:55.286649Z

Sounds good

RAJKUMAR 2024-08-31T17:49:59.739079Z

Thanks @ikitommi

RAJKUMAR 2024-08-31T17:53:38.675909Z

I created the issue https://github.com/metosin/schema-tools/issues/91

RAJKUMAR 2024-08-30T21:59:05.735089Z

(require '[schema-tools.core :as st])
(require '[schema.coerce :as sc])

(def input-map {:a "a" :b 2})

(schema.core/defschema input-schema 
  (linked.core/map 
    :a schema.core/Str))

(st/select-schema input-map input-schema sc/json-coercion-matcher)

RAJKUMAR 2024-08-30T23:01:59.940839Z

The error is

RAJKUMAR 2024-08-30T23:02:02.285619Z

Execution error (ExceptionInfo) at schema-tools.coerce/coerce-or-error! (coerce.cljc:24).
Could not coerce value to schema: (not ((partial instance? LinkedMap) {:a "a"}))