From 358aec0300bf600a2344cef32d0bad3bf3db2e63 Mon Sep 17 00:00:00 2001 From: Girish S Date: Fri, 31 Mar 2017 18:58:47 +0530 Subject: [PATCH] decode nested Lists of ComplexType --- elm/TypeAlias.elm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/elm/TypeAlias.elm b/elm/TypeAlias.elm index 36355af..7ed81fa 100644 --- a/elm/TypeAlias.elm +++ b/elm/TypeAlias.elm @@ -107,6 +107,9 @@ fieldFormat field = ComplexType -> (camelCase field.name) ++ " : " ++ (fullyQualifiedName field) + ListType ComplexType -> + (camelCase field.name) ++ " : " ++ (fullyQualifiedName field) + _ -> (camelCase field.name) ++ " : " ++ (Types.knownTypesToString field.typeName) @@ -136,7 +139,7 @@ generateFields stuff base = value = Types.unsafeGet key stuff - name = + typeName = Types.suggestType value newBase = @@ -147,11 +150,11 @@ generateFields stuff base = field = { base = String.trim base , name = String.trim key - , typeName = name + , typeName = typeName , value = value } in - if name == ComplexType then + if typeName == ComplexType || typeName == ListType ComplexType then generateFields value newBase ++ [ field ] else [ field ]