Skip to content

Commit 5869bf7

Browse files
authored
Merge pull request #85 from yetanalytics/empty-lang-maps
Empty language maps
2 parents 84e2199 + 56123ef commit 5869bf7

4 files changed

Lines changed: 7 additions & 10 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@
1616
/resources/public/xapi_schema.js
1717
.specljs-timestamp
1818
/.cpcache
19+
/.calva
20+
/.clj-kondo
21+
/.lsp

README.org

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You can use xapi-schema to validate (and generate) statements in real-time [[htt
1515
** Getting Started
1616
1. Add to your project dependencies:
1717
#+BEGIN_SRC clojure
18-
[[com.yetanalytics/xapi-schema "1.2.1"]]
18+
[[com.yetanalytics/xapi-schema "1.3.0"]]
1919
#+END_SRC
2020
2. Require in your project:
2121
#+BEGIN_SRC clojure

src/xapi_schema/spec.cljc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,7 @@
106106
(s/def ::language-map
107107
(s/map-of ::language-tag
108108
::language-map-text
109-
:gen-max 3
110-
;; Technically, empty language maps are allowed under the xAPI spec.
111-
;; However, they are nonsensical in most contexts and will not
112-
;; work in downstream libs (e.g those that use DynamoDB).
113-
:min-count 1))
109+
:gen-max 3))
114110

115111

116112
(defn into-str [cs]

test/xapi_schema/spec_test.cljc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@
4040
{"en-US" "foo"}
4141
{"es" "hola mundo"}
4242
{"zh-cmn" "你好世界"}
43+
{} ; empty lang maps are allowed by spec
4344
:bad
4445
{"hey there" "foo"}
45-
{"en" 2}
46-
;; We do not allow for empty maps (despite technically
47-
;; being spec-conformant)
48-
{})))
46+
{"en" 2})))
4947

5048
(deftest iri-test
5149
(testing "must be a valid url with scheme"

0 commit comments

Comments
 (0)