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

Add lower bound on yojson 2.0 #133

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.19.0
version=0.24.1
break-cases=toplevel
break-fun-decl=fit-or-vertical
break-infix=fit-or-vertical
Expand Down
1 change: 1 addition & 0 deletions .ocamlformat-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/syntax.ml
2 changes: 1 addition & 1 deletion aws-autoscaling.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"cohttp-lwt" {with-test & >= "2.4.0"}
"cohttp-lwt-unix" {with-test & >= "2.4.0"}
"lwt" {with-test & >= "4.0.0"}
"yojson" {with-test & >= "1.7.0"}
"yojson" {with-test & >= "2.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
2 changes: 1 addition & 1 deletion aws-cloudformation.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"cohttp-lwt" {with-test & >= "2.4.0"}
"cohttp-lwt-unix" {with-test & >= "2.4.0"}
"lwt" {with-test & >= "4.0.0"}
"yojson" {with-test & >= "1.7.0"}
"yojson" {with-test & >= "2.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
2 changes: 1 addition & 1 deletion aws-cloudtrail.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"cohttp-lwt" {with-test & >= "2.4.0"}
"cohttp-lwt-unix" {with-test & >= "2.4.0"}
"lwt" {with-test & >= "4.0.0"}
"yojson" {with-test & >= "1.7.0"}
"yojson" {with-test & >= "2.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
2 changes: 1 addition & 1 deletion aws-cloudwatch.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"cohttp-lwt" {with-test & >= "2.4.0"}
"cohttp-lwt-unix" {with-test & >= "2.4.0"}
"lwt" {with-test & >= "4.0.0"}
"yojson" {with-test & >= "1.7.0"}
"yojson" {with-test & >= "2.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
2 changes: 1 addition & 1 deletion aws-ec2.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"cohttp-lwt" {with-test & >= "2.4.0"}
"cohttp-lwt-unix" {with-test & >= "2.4.0"}
"lwt" {with-test & >= "4.0.0"}
"yojson" {with-test & >= "1.7.0"}
"yojson" {with-test & >= "2.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
2 changes: 1 addition & 1 deletion aws-elasticache.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"cohttp-lwt" {with-test & >= "2.4.0"}
"cohttp-lwt-unix" {with-test & >= "2.4.0"}
"lwt" {with-test & >= "4.0.0"}
"yojson" {with-test & >= "1.7.0"}
"yojson" {with-test & >= "2.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
2 changes: 1 addition & 1 deletion aws-elasticloadbalancing.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"cohttp-lwt" {with-test & >= "2.4.0"}
"cohttp-lwt-unix" {with-test & >= "2.4.0"}
"lwt" {with-test & >= "4.0.0"}
"yojson" {with-test & >= "1.7.0"}
"yojson" {with-test & >= "2.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
5 changes: 2 additions & 3 deletions aws-gen.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git"
depends: [
"ocaml" {>= "4.08"}
"atdgen" {>= "2.10"}
"yojson"
"yojson" {>= "2.0"}
"base-unix"
"cmdliner" {>= "1.1.0"}
"fmt"
"yojson" {>= "1.6.0"}
"fmt" {>= "0.9.0"}
"ocaml-compiler-libs" {>= "0.11.0" }
"ocamlgraph"
"dune" {>= "2.7"}
Expand Down
2 changes: 1 addition & 1 deletion aws-kms.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"cohttp-lwt" {with-test & >= "2.4.0"}
"cohttp-lwt-unix" {with-test & >= "2.4.0"}
"lwt" {with-test & >= "4.0.0"}
"yojson" {with-test & >= "1.7.0"}
"yojson" {with-test & "2.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
2 changes: 1 addition & 1 deletion aws-rds.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"cohttp-lwt" {with-test & >= "2.4.0"}
"cohttp-lwt-unix" {with-test & >= "2.4.0"}
"lwt" {with-test & >= "4.0.0"}
"yojson" {with-test & >= "1.7.0"}
"yojson" {with-test & >= "2.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
2 changes: 1 addition & 1 deletion aws-route53.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"cohttp-lwt" {with-test & >= "2.4.0"}
"cohttp-lwt-unix" {with-test & >= "2.4.0"}
"lwt" {with-test & >= "4.0.0"}
"yojson" {with-test & >= "1.7.0"}
"yojson" {with-test & "2.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
2 changes: 1 addition & 1 deletion aws-sdb.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"cohttp-lwt" {with-test & >= "2.4.0"}
"cohttp-lwt-unix" {with-test & >= "2.4.0"}
"lwt" {with-test & >= "4.0.0"}
"yojson" {with-test & >= "1.7.0"}
"yojson" {with-test & >= "2.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
2 changes: 1 addition & 1 deletion aws-sqs.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"cohttp-lwt" {with-test & >= "2.4.0"}
"cohttp-lwt-unix" {with-test & >= "2.4.0"}
"lwt" {with-test & >= "4.0.0"}
"yojson" {with-test & >= "1.7.0"}
"yojson" {with-test & >= "2.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
2 changes: 1 addition & 1 deletion aws-ssm.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"cohttp-lwt" {with-test & >= "2.4.0"}
"cohttp-lwt-unix" {with-test & >= "2.4.0"}
"lwt" {with-test & >= "4.0.0"}
"yojson" {with-test & >= "1.7.0"}
"yojson" {with-test & >= "2.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
2 changes: 1 addition & 1 deletion aws-sts.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ depends: [
"cohttp-lwt" {with-test & >= "2.4.0"}
"cohttp-lwt-unix" {with-test & >= "2.4.0"}
"lwt" {with-test & >= "4.0.0"}
"yojson" {with-test & >= "1.7.0"}
"yojson" {with-test & >= "2.0"}
]
build: [
["dune" "subst"] {pinned}
Expand Down
6 changes: 0 additions & 6 deletions lib/aws.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,13 @@ module Signing = Signing

module type Call = sig
type input

type output

type error

val signature_version : Request.signature_version

val service : string

val to_http : string -> string -> input -> Request.t

val of_http : string -> [ `Ok of output | `Error of error Error.error_response ]

val parse_error : int -> string -> error option
end

Expand Down
17 changes: 0 additions & 17 deletions lib/aws.mli
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ module Time : sig
format. *)

val date_time_iso8601 : CalendarLib.Calendar.t -> string

val now_utc : unit -> CalendarLib.Calendar.t

val format : CalendarLib.Calendar.t -> string
Expand Down Expand Up @@ -291,11 +290,8 @@ end
module Signing : sig
module Hash : sig
val _sha256 : ?key:string -> string -> Digestif.SHA256.t

val sha256 : ?key:string -> string -> string

val sha256_hex : ?key:string -> string -> string

val sha256_base64 : ?key:string -> string -> string
end

Expand Down Expand Up @@ -352,34 +348,21 @@ module BaseTypes : sig
type t

val to_json : t -> Json.t

val of_json : Json.t -> t

val to_query : t -> Query.t

val parse : Ezxmlm.nodes -> t option

val to_string : t -> string

val of_string : string -> t
end

module Unit : Base with type t = unit

module String : Base with type t = string

module Blob : Base with type t = string

module Boolean : Base with type t = bool

module Integer : Base with type t = int

module Long : Base with type t = int

module Double : Base with type t = float

module Float : Base with type t = float

module DateTime : Base with type t = CalendarLib.Calendar.t
end

Expand Down
16 changes: 0 additions & 16 deletions lib/baseTypes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@ module type Base = sig
type t

val to_json : t -> Json.t

val of_json : Json.t -> t

val to_query : t -> Query.t

val parse : Ezxmlm.nodes -> t option

val to_string : t -> string

val of_string : string -> t
end

Expand All @@ -27,11 +22,8 @@ module Unit = struct
| t -> raise (Json.Casting_error ("unit", t))

let to_query () = List []

let parse _ = Some () (* XXX(seliopou): Should never be used, maybe assert that? *)

let to_string _ = raise (Failure "unit")

let of_string _ = raise (Failure "unit")
end

Expand All @@ -45,11 +37,8 @@ module String = struct
| t -> raise (Json.Casting_error ("string", t))

let to_query s = Value (Some s)

let parse s = Some (data_to_string s)

let to_string s = s

let of_string s = s
end

Expand Down Expand Up @@ -106,7 +95,6 @@ module Integer = struct
| Some s -> ( try Some (int_of_string s) with Failure _ -> None)

let to_string i = string_of_int i

let of_string s = int_of_string s
end

Expand All @@ -129,7 +117,6 @@ module Float = struct
| Some s -> ( try Some (float_of_string s) with Failure _ -> None)

let to_string f = string_of_float f

let of_string s = float_of_string s
end

Expand All @@ -139,9 +126,7 @@ module DateTime = struct
type t = CalendarLib.Calendar.t

let to_json c = `String (Time.format c)

let of_json t = Time.parse (String.of_json t)

let to_query c = Value (Some (Time.format c))

let parse c =
Expand All @@ -150,6 +135,5 @@ module DateTime = struct
| Some s -> ( try Some (Time.parse s) with Invalid_argument _ -> None)

let to_string c = Time.format c

let of_string s = Time.parse s
end
Loading