Skip to content

Commit

Permalink
default: fix bool type
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisgio committed Jan 11, 2025
1 parent 2ad215d commit 7ecbe6f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/generator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ let rec ocaml_value_of_json ~typ = function
| _ -> (Yojson.Basic.to_string json)

)
| `String value -> sprintf "\\\"%s\\\"" value
| `String value ->
(match typ with
| Some Boolean -> value
| Some Integer -> value
| _ ->
sprintf "\\\"%s\\\"" value
)
| `List elements ->
let list_elements = List.map (ocaml_value_of_json ~typ:None) elements |> String.concat ";" in
sprintf "[%s]" list_elements
Expand Down

0 comments on commit 7ecbe6f

Please sign in to comment.