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

Handle more parsing cases (int and str formats, additional props: fix #10, #11 and #13) #12

Merged
merged 17 commits into from
Feb 17, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Handle empty objects
smondet committed Nov 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b35ddbd5c5299e8f2fb7dea0221b2771ca03e0be
1 change: 1 addition & 0 deletions lib/generator.ml
Original file line number Diff line number Diff line change
@@ -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"