Skip to content

Commit cd9291e

Browse files
committed
fix: Make fields added in PR #320 optional
This ensures learn-ocaml-client.master is still able to query a server version learn-ocaml.0.12. Minimal working example: cd .../learn-ocaml docker run --name=locaml -d -it -p 8080:8080 -v "$PWD/demo-repository:/repository" ocamlsf/learn-ocaml:0.12 TOKEN=$(docker logs locaml | grep -e 'Initial teacher token created:' | sed -e 's/^.*: //') # then git checkout 42d8127 opam install . --deps-only --locked -y opam install -y opam-installer.$(opam config var opam-version) eval $(opam env) make make opaminstall learn-ocaml-client init -s http://localhost:8080 -t "$TOKEN" touch demo.ml learn-ocaml-client grade demo.ml Output before the fix: Fatal error: exception Json_encoding.Cannot_destruct(_) Called from unknown location Called from unknown location Called from unknown location Called from unknown location Called from unknown location Called from unknown location Called from unknown location
1 parent c00a3ab commit cd9291e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/repo/learnocaml_exercise.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ let encoding =
3737
(req "test" string)
3838
(req "solution" string)
3939
(req "max-score" int)
40-
(req "depend" (option string))
41-
(req "dependencies" (list string)))
40+
(opt "depend" (string))
41+
(dft "dependencies" (list string) []))
4242

4343
(* let meta_from_string m =
4444
* Ezjsonm.from_string m

0 commit comments

Comments
 (0)