Skip to content

Commit

Permalink
allow unqualified keywords as the keys of json types
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hewitt committed Mar 26, 2020
1 parent a5fc531 commit 2596f4c
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/roomkey/dryline/simple_intrinsic_function.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,37 @@
any?))

(s/def ::string
(clojure.spec.alpha/or
:primitive string?
:simple-intrinsic-function ::simple-intrinsic-function))
(s/or :primitive string?
:simple-intrinsic-function ::simple-intrinsic-function))

(s/def ::integer
(clojure.spec.alpha/or
:primitive int?
:simple-intrinsic-function ::simple-intrinsic-function))
(s/or :primitive int?
:simple-intrinsic-function ::simple-intrinsic-function))

(s/def ::double
(clojure.spec.alpha/or
:primitive double?
:simple-intrinsic-function ::simple-intrinsic-function))
(s/or :primitive double?
:simple-intrinsic-function ::simple-intrinsic-function))

(s/def ::boolean
(clojure.spec.alpha/or
:primitive boolean?
:simple-intrinsic-function ::simple-intrinsic-function))
(s/or :primitive boolean?
:simple-intrinsic-function ::simple-intrinsic-function))

(s/def ::timestamp
(clojure.spec.alpha/or
:primitive inst?
:simple-intrinsic-function ::simple-intrinsic-function))
(s/or :primitive inst?
:simple-intrinsic-function ::simple-intrinsic-function))

(s/def ::unqualified-keyword
(s/and keyword? (complement qualified-keyword?)))

(s/def ::json
(s/or :string ::string
:integer ::integer
:double ::double
:boolean ::boolean
:vector (s/coll-of ::json :kind vector?)
:map (s/map-of string? ::json)))
:map (s/map-of (s/or :string string?
:unqualified-keyword ::unqualified-keyword)
::json)))

(def primitive-type->spec
"A map from CF PrimitiveType to clojure predicates"
Expand Down

0 comments on commit 2596f4c

Please sign in to comment.