Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ezjsonm dependency #76

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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