Skip to content

Commit f94e04a

Browse files
committed
Prefix List functions with Stdlib as the fake petstore generates a List module
1 parent 01dc674 commit f94e04a

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

modules/openapi-generator/src/main/resources/ocaml/json.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ let of_int32 x = `Intlit (Int32.to_string x)
5050

5151
let of_int64 x = `Intlit (Int64.to_string x)
5252

53-
let of_list_of of_f l = `List (List.map of_f l)
53+
let of_list_of of_f l = `List (Stdlib.List.map of_f l)
5454

55-
let of_map_of of_f l = `Assoc (List.map (fun (k, v) -> (k, of_f v)) l)
55+
let of_map_of of_f l = `Assoc (Stdlib.List.map (fun (k, v) -> (k, of_f v)) l)

modules/openapi-generator/src/main/resources/ocaml/support.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ let read_json_body_as_list resp body =
5252
Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_list)
5353

5454
let read_json_body_as_list_of of_json resp body =
55-
Lwt.(read_json_body_as_list resp body >|= List.map of_json)
55+
Lwt.(read_json_body_as_list resp body >|= Stdlib.List.map of_json)
5656

5757
let read_json_body_as_map resp body =
5858
Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_assoc)
5959

6060
let read_json_body_as_map_of of_json resp body =
61-
Lwt.(read_json_body_as_map resp body >|= List.map (fun (s, v) -> (s, of_json v)))
61+
Lwt.(read_json_body_as_map resp body >|= Stdlib.List.map (fun (s, v) -> (s, of_json v)))
6262

6363
let replace_string_path_param uri param_name param_value =
6464
let regexp = Str.regexp (Str.quote ("{" ^ param_name ^ "}")) in
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{#isContainer}}{{#items}}(List.map {{> to_string}}){{/items}}{{/isContainer}}{{^isEnum}}{{#isLong}}Int64.to_string{{/isLong}}{{#isInteger}}Int32.to_string{{/isInteger}}{{#isFloat}}string_of_float{{/isFloat}}{{#isNumber}}string_of_float{{/isNumber}}{{#isDouble}}string_of_float{{/isDouble}}{{#isBoolean}}string_of_bool{{/isBoolean}}{{#isFile}}(fun x -> x){{/isFile}}{{#isDate}}(fun x -> x){{/isDate}}{{#isDateTime}}(fun x -> x){{/isDateTime}}{{#isString}}(fun x -> x){{/isString}}{{#isByteArray}}(fun x -> x){{/isByteArray}}{{#isModel}}{{{vendorExtensions.x-model-module}}}.show{{/isModel}}{{/isEnum}}{{^isModel}}{{^isContainer}}{{#isEnum}}Enums.show_{{{datatypeWithEnum}}}{{/isEnum}}{{/isContainer}}{{/isModel}}
1+
{{#isContainer}}{{#items}}(Stdlib.List.map {{> to_string}}){{/items}}{{/isContainer}}{{^isEnum}}{{#isLong}}Int64.to_string{{/isLong}}{{#isInteger}}Int32.to_string{{/isInteger}}{{#isFloat}}string_of_float{{/isFloat}}{{#isNumber}}string_of_float{{/isNumber}}{{#isDouble}}string_of_float{{/isDouble}}{{#isBoolean}}string_of_bool{{/isBoolean}}{{#isFile}}(fun x -> x){{/isFile}}{{#isDate}}(fun x -> x){{/isDate}}{{#isDateTime}}(fun x -> x){{/isDateTime}}{{#isString}}(fun x -> x){{/isString}}{{#isByteArray}}(fun x -> x){{/isByteArray}}{{#isModel}}{{{vendorExtensions.x-model-module}}}.show{{/isModel}}{{/isEnum}}{{^isModel}}{{^isContainer}}{{#isEnum}}Enums.show_{{{datatypeWithEnum}}}{{/isEnum}}{{/isContainer}}{{/isModel}}

0 commit comments

Comments
 (0)