Skip to content

Commit

Permalink
Remove ezjsonm dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgilchrist committed Nov 29, 2022
1 parent f0b6cdc commit 6eb1da3
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Unreleased

## Bug fixes
* Drop ezjsonm dependency for `gitlab` (#76 @tmcgilchrist)

## Bug fixes
* `gitlab.atd`: `description` is nullable (#75 @maiste)

# 0.1.6 - 2022-11-08
Expand Down
1 change: 0 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
(cohttp-lwt (>= 4.0))
(atdgen (>= 2.8.0))
(yojson (>= 1.7.0))
ezjsonm
(ISO8601 (>= 0.2.6))
stringext)
(synopsis "GitLab APIv4 OCaml library")
Expand Down
3 changes: 2 additions & 1 deletion gitlab-unix.opam
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ depends: [
"alcotest" {with-test}
"odoc" {with-doc}
]
dev-repo: "git+https://github.com/tmcgilchrist/ocaml-gitlab.git"
build: [
["dune" "subst"] {dev}
[
Expand All @@ -41,5 +42,5 @@ build: [
]
["dune" "install" "-p" name "--create-install-files" name]
]
dev-repo: "git+https://github.com/tmcgilchrist/ocaml-gitlab.git"

available: [ arch != "x86_32" & arch != "arm32" & arch != "ppc32" ]
1 change: 0 additions & 1 deletion gitlab.opam
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ depends: [
"cohttp-lwt" {>= "4.0"}
"atdgen" {>= "2.8.0"}
"yojson" {>= "1.7.0"}
"ezjsonm"
"ISO8601" {>= "0.2.6"}
"stringext"
"odoc" {with-doc}
Expand Down
2 changes: 1 addition & 1 deletion lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
(public_name gitlab)
(wrapped false)
(modules gitlab_s gitlab_core gitlab_j gitlab_t gitlab_json)
(libraries cohttp-lwt ISO8601 ezjsonm uri yojson atdgen str))
(libraries cohttp-lwt ISO8601 uri yojson atdgen str))
6 changes: 4 additions & 2 deletions lib/gitlab_json.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ module Adapter = struct
end)
end

exception Parse_error of Yojson.Safe.t * string

module Date = struct
type t = float

let wrap str =
try ISO8601.Permissive.date str
with Failure _ ->
raise
(Ezjsonm.Parse_error
(Parse_error
( `String str,
Format.sprintf "%s: Date.wrap can't parse date format YYYY-MM-DD"
str ))
Expand All @@ -30,7 +32,7 @@ module DateTime = struct
try ISO8601.Permissive.datetime str
with Failure _ ->
raise
(Ezjsonm.Parse_error
(Parse_error
( `String str,
Format.sprintf "%s: DateTime.wrap can't parse ISO8601 date" str ))

Expand Down

0 comments on commit 6eb1da3

Please sign in to comment.