@@ -448,43 +448,45 @@ private static ArrayList<Argument> setResponseFields(Field[] responseFields) {
448448
449449 for (Field responseField : responseFields ) {
450450 SerializedName nameAnnotation = responseField .getAnnotation (SerializedName .class );
451- Param paramAnnotation = responseField .getAnnotation (Param .class );
452- Argument respArg = new Argument (nameAnnotation .value ());
453-
454- boolean hasChildren = false ;
455- if (paramAnnotation != null && paramAnnotation .includeInApiDoc ()) {
456- String description = paramAnnotation .description ();
457- Class fieldClass = paramAnnotation .responseObject ();
458- if (description != null && !description .isEmpty ()) {
459- respArg .setDescription (description );
460- }
461-
462- if (fieldClass != null ) {
463- Class <?> superClass = fieldClass .getSuperclass ();
464- if (superClass != null ) {
465- String superName = superClass .getName ();
466- if (superName .equals (BaseResponse .class .getName ())) {
467- ArrayList <Argument > fieldArguments = new ArrayList <Argument >();
468- Field [] fields = fieldClass .getDeclaredFields ();
469- fieldArguments = setResponseFields (fields );
470- respArg .setArguments (fieldArguments );
471- hasChildren = true ;
472- }
473- }
474- }
475- }
476-
477- if (paramAnnotation != null && paramAnnotation .includeInApiDoc ()) {
478- if (nameAnnotation .value ().equals ("id" )) {
479- id = respArg ;
480- } else {
481- if (hasChildren ) {
482- respArg .setName (nameAnnotation .value () + "(*)" );
483- sortedArguments .add (respArg );
484- } else {
485- sortedChildlessArguments .add (respArg );
486- }
487- }
451+ if (nameAnnotation != null ) {
452+ Param paramAnnotation = responseField .getAnnotation (Param .class );
453+ Argument respArg = new Argument (nameAnnotation .value ());
454+
455+ boolean hasChildren = false ;
456+ if (paramAnnotation != null && paramAnnotation .includeInApiDoc ()) {
457+ String description = paramAnnotation .description ();
458+ Class fieldClass = paramAnnotation .responseObject ();
459+ if (description != null && !description .isEmpty ()) {
460+ respArg .setDescription (description );
461+ }
462+
463+ if (fieldClass != null ) {
464+ Class <?> superClass = fieldClass .getSuperclass ();
465+ if (superClass != null ) {
466+ String superName = superClass .getName ();
467+ if (superName .equals (BaseResponse .class .getName ())) {
468+ ArrayList <Argument > fieldArguments = new ArrayList <Argument >();
469+ Field [] fields = fieldClass .getDeclaredFields ();
470+ fieldArguments = setResponseFields (fields );
471+ respArg .setArguments (fieldArguments );
472+ hasChildren = true ;
473+ }
474+ }
475+ }
476+ }
477+
478+ if (paramAnnotation != null && paramAnnotation .includeInApiDoc ()) {
479+ if (nameAnnotation .value ().equals ("id" )) {
480+ id = respArg ;
481+ } else {
482+ if (hasChildren ) {
483+ respArg .setName (nameAnnotation .value () + "(*)" );
484+ sortedArguments .add (respArg );
485+ } else {
486+ sortedChildlessArguments .add (respArg );
487+ }
488+ }
489+ }
488490 }
489491 }
490492
0 commit comments