Browse files

Handle additionalProperties of ref type

  • Loading branch information...
1 parent 5914476 commit 8994fc718ed91b7d61d2d723636edbd04de5f7a3 @astrada committed Sep 24, 2013
Showing with 12 additions and 3 deletions.
  1. +12 −3 tools/serviceGeneratorState.ml
View
15 tools/serviceGeneratorState.ml
@@ -890,7 +890,7 @@ struct
type_t;
inner_modules;
}
- | ComplexType.Reference type_name ->
+ | ComplexType.Reference _ ->
let module_name =
ComplexType.get_module_name ocaml_name complex_type in
let type_t = Alias module_name in
@@ -899,13 +899,22 @@ struct
type_t;
inner_modules = [];
}
- | ComplexType.Dictionary { ComplexType.data_type = ComplexType.Scalar { ScalarType.data_type = ScalarType.String } } ->
+ | ComplexType.Dictionary { ComplexType.data_type = ComplexType.Scalar { ScalarType.data_type = ScalarType.String } }
+ | ComplexType.Dictionary { ComplexType.data_type = ComplexType.Reference _ } ->
{ original_name = complex_type.ComplexType.id;
ocaml_name;
type_t = Alias "GapiJson.StringDictionary";
inner_modules = [];
}
- | _ -> failwith "Unsupported complex_type in Record.create"
+ | ComplexType.Scalar { ScalarType.original_type = "any" } ->
+ { original_name = complex_type.ComplexType.id;
+ ocaml_name;
+ type_t = Alias "String";
+ inner_modules = [];
+ }
+ | _ -> failwith
+ ("Unsupported complex_type in Record.create (id = "
+ ^ complex_type.ComplexType.id ^ ")")
end

0 comments on commit 8994fc7

Please sign in to comment.