Skip to content

Commit 988e159

Browse files
tatchiandreypopp
authored andcommitted
make bool of/to_url_query consistent with other types
1 parent 13c994b commit 988e159

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

native/runtime/ppx_deriving_router_primitives.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ let int_of_url_query k xs =
4141
| None -> Error "not an integer value"
4242
| Some x -> Ok x))
4343

44-
let bool_to_url_query k x = if x then [ k, "true" ] else []
44+
let bool_to_url_query k x = if x then [ k, "true" ] else [ k, "false" ]
4545

4646
let bool_of_url_query k xs =
4747
last_wins k xs (function
48-
| None -> Ok false
48+
| None -> Error "missing value"
4949
| Some "true" -> Ok true
5050
| Some "false" -> Ok false
5151
| _ -> Error "not a boolean value (true, false)")

0 commit comments

Comments
 (0)