@@ -815,15 +815,18 @@ private CWLElement getDetails(Object inputOutput) {
815
815
// Shorthand notation "id: type" - no label/doc/other params
816
816
if (inputOutput .getClass () == String .class ) {
817
817
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 ));
823
826
824
827
// 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 )));
827
830
}
828
831
}
829
832
@@ -966,7 +969,7 @@ private String extractTypes(Object typeNode) {
966
969
// Multiple types, build a string to represent them
967
970
StringBuilder typeDetails = new StringBuilder ();
968
971
boolean optional = false ;
969
- for (Object type : (List <String >) typeNode ) {
972
+ for (Object type : (List <Object >) typeNode ) {
970
973
if (type .getClass () == String .class ) {
971
974
// This is a simple type
972
975
if (((String ) type ).equals ("null" )) {
@@ -981,8 +984,13 @@ private String extractTypes(Object typeNode) {
981
984
// This is a verbose type with sub-fields broken down into type: and other
982
985
// params
983
986
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
+ }
986
994
} else {
987
995
typeDetails .append ((String ) ((Map <String , Object >) type ).get (TYPE ));
988
996
}
0 commit comments