Skip to content

Commit

Permalink
Add unix-time int format support
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhuman authored and ixzzd committed Jun 26, 2024
1 parent 08063b1 commit f45a508
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/generator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ let define_type ~doc ~name ~type_ =

let process_int_type schema =
match schema.format with
| None | Some `Int32 -> "int"
| None | Some `Int32 | Some `UnixTime -> "int"
| Some `Int64 -> "int64"
| _ -> failwith "int has unextected format"
| _ -> failwith "int has unexpected format"

let get_ref_name ref =
let uri, pointer =
Expand Down
1 change: 1 addition & 0 deletions lib/json_schema.atd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type typ = [
type int_format = [
| Int32 <json name="int32">
| Int64 <json name="int64">
| UnixTime <json name="unix-time">
]

type number_format = [
Expand Down

0 comments on commit f45a508

Please sign in to comment.