Skip to content

Commit

Permalink
Aws_gen: add support for additionalValues
Browse files Browse the repository at this point in the history
  • Loading branch information
zbaylin committed Apr 1, 2022
1 parent 9c5e725 commit 777b5d7
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions src/aws_gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,26 @@ module Json = struct
let open Yojson.Basic.Util in
let original = to_assoc original in
let overrides = to_assoc overrides in
`Assoc
(List.map
(fun (key, val_) ->
if key = "shapes"
then
let types =
try to_assoc (List.assoc "typeOverrides" overrides) with _ -> []
in
key, `Assoc (override_shapes (to_assoc val_) types)
else key, val_)
original)
let overriden =
`Assoc
(List.map
(fun (key, val_) ->
if key = "shapes"
then
let types =
try to_assoc (List.assoc "typeOverrides" overrides) with _ -> []
in
key, `Assoc (override_shapes (to_assoc val_) types)
else key, val_)
original)
in
let overriden =
let additional_values =
`Assoc (try to_assoc (List.assoc "additionalValues" overrides) with _ -> [])
in
merge overriden additional_values
in
overriden
end

let log s = Printf.eprintf (s ^^ "\n%!")
Expand Down

0 comments on commit 777b5d7

Please sign in to comment.