@@ -815,15 +815,18 @@ private CWLElement getDetails(Object inputOutput) {
815815 // Shorthand notation "id: type" - no label/doc/other params
816816 if (inputOutput .getClass () == String .class ) {
817817 details .setType ((String ) inputOutput );
818- } else {
819- details .setLabel (extractLabel ((Map <String , Object >) inputOutput ));
820- details .setDoc (extractDoc ((Map <String , Object >) inputOutput ));
821- extractSource ((Map <String , Object >) inputOutput ).forEach (details ::addSourceID );
822- details .setDefaultVal (extractDefault ((Map <String , Object >) inputOutput ));
818+ } else if (List .class .isAssignableFrom (inputOutput .getClass ())) {
819+ details .setType (this .extractTypes (inputOutput ));
820+ } else if (Map .class .isAssignableFrom (inputOutput .getClass ())) {
821+ Map <String , Object > iOMap = (Map <String , Object >) inputOutput ;
822+ details .setLabel (extractLabel (iOMap ));
823+ details .setDoc (extractDoc (iOMap ));
824+ extractSource (iOMap ).forEach (details ::addSourceID );
825+ details .setDefaultVal (extractDefault (iOMap ));
823826
824827 // Type is only for inputs
825- if ((( Map < String , Object >) inputOutput ) .containsKey (TYPE )) {
826- details .setType (extractTypes ((( Map < String , Object >) inputOutput ) .get (TYPE )));
828+ if (iOMap .containsKey (TYPE )) {
829+ details .setType (extractTypes (iOMap .get (TYPE )));
827830 }
828831 }
829832
@@ -966,7 +969,7 @@ private String extractTypes(Object typeNode) {
966969 // Multiple types, build a string to represent them
967970 StringBuilder typeDetails = new StringBuilder ();
968971 boolean optional = false ;
969- for (Object type : (List <String >) typeNode ) {
972+ for (Object type : (List <Object >) typeNode ) {
970973 if (type .getClass () == String .class ) {
971974 // This is a simple type
972975 if (((String ) type ).equals ("null" )) {
@@ -981,8 +984,13 @@ private String extractTypes(Object typeNode) {
981984 // This is a verbose type with sub-fields broken down into type: and other
982985 // params
983986 if (((Map <String , Object >) type ).get (TYPE ).equals (ARRAY )) {
984- typeDetails .append ((String ) ((Map <String , Object >) type ).get (ARRAY_ITEMS ));
985- typeDetails .append ("[], " );
987+ Object items = ((Map <String , Object >) type ).get (ARRAY_ITEMS );
988+ if (items .getClass () == String .class ) {
989+ typeDetails .append (items );
990+ typeDetails .append ("[], " );
991+ } else {
992+ typeDetails .append (type .toString () + ", " );
993+ }
986994 } else {
987995 typeDetails .append ((String ) ((Map <String , Object >) type ).get (TYPE ));
988996 }
0 commit comments