Skip to content

Commit

Permalink
Handle empty objects
Browse files Browse the repository at this point in the history
  • Loading branch information
smondet committed Nov 25, 2024
1 parent 8c9edad commit b35ddbd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/generator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ and process_object_type ~ancestors schema =
| _, false -> sprintf " ?%s %s: %s option;" record_field_name doc type_
in
match schema.properties with
| Some [] -> sprintf "{\n dummy: unit\n}"
| Some properties -> sprintf "{\n%s\n}" (properties |> List.map make_record_field |> String.concat "\n")
| None -> "json"

Expand Down

0 comments on commit b35ddbd

Please sign in to comment.