Fix(plugins/json_schema): don't translate the TUnit type into "null" anymore (#461)

This commit is contained in:
Denis Merigoux 2023-05-02 10:59:39 +02:00 committed by GitHub
commit 9c1b51b1a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 16 deletions

View File

@ -48,7 +48,6 @@ module To_json = struct
let fmt_tlit fmt (tlit : typ_lit) =
match tlit with
| TUnit -> Format.fprintf fmt "\"type\": \"null\",@\n\"default\": null"
| TInt | TRat -> Format.fprintf fmt "\"type\": \"number\",@\n\"default\": 0"
| TMoney ->
Format.fprintf fmt
@ -56,6 +55,10 @@ module To_json = struct
| TBool -> Format.fprintf fmt "\"type\": \"boolean\",@\n\"default\": false"
| TDate -> Format.fprintf fmt "\"type\": \"string\",@\n\"format\": \"date\""
| TDuration -> failwith "TODO: tlit duration"
| TUnit ->
(* NOTE(@EmileRolley): we previously used the "null" type for unit, but it
is not working properly so we simply decided to remove it. *)
()
let rec fmt_type fmt (typ : typ) =
match Marked.unmark typ with

File diff suppressed because one or more lines are too long