@@ -86,14 +86,10 @@ public void buildGenericResponse(Components components, Map<String, Object> find
86
86
87
87
protected Schema calculateSchemaParameterizedType (Components components , ParameterizedType parameterizedType ) {
88
88
Schema schemaN = null ;
89
- if ( parameterizedType .getActualTypeArguments ()[0 ] instanceof Class
90
- && !Void .class .equals (parameterizedType . getActualTypeArguments ()[ 0 ] )) {
89
+ Type type = parameterizedType .getActualTypeArguments ()[0 ];
90
+ if (( type instanceof Class || type instanceof ParameterizedType ) && !Void .class .equals (type )) {
91
91
schemaN = calculateSchema (components , parameterizedType );
92
- } else if (parameterizedType .getActualTypeArguments ()[0 ] instanceof ParameterizedType
93
- && !Void .class .equals (parameterizedType .getActualTypeArguments ()[0 ])) {
94
- parameterizedType = (ParameterizedType ) parameterizedType .getActualTypeArguments ()[0 ];
95
- schemaN = SpringDocAnnotationsUtils .extractSchema (components , parameterizedType );
96
- } else if (Void .class .equals (parameterizedType .getActualTypeArguments ()[0 ])) {
92
+ } else if (Void .class .equals (type )) {
97
93
// if void, no content
98
94
schemaN = AnnotationsUtils .resolveSchemaFromType (String .class , null , null );
99
95
}
@@ -127,9 +123,11 @@ private Map<String, ApiResponse> computeResponse(Components components, Method m
127
123
ApiResponse apiResponse1 = new ApiResponse ();
128
124
apiResponse1 .setDescription (apiResponse2 .description ());
129
125
io .swagger .v3 .oas .annotations .media .Content [] contentdoc = apiResponse2 .content ();
130
- SpringDocAnnotationsUtils .getContent (contentdoc , new String [0 ],
131
- methodAttributes .getAllProduces () == null ? new String [0 ] : methodAttributes .getAllProduces (),
132
- null , components , null )
126
+ SpringDocAnnotationsUtils
127
+ .getContent (contentdoc , new String [0 ],
128
+ methodAttributes .getAllProduces () == null ? new String [0 ]
129
+ : methodAttributes .getAllProduces (),
130
+ null , components , null )
133
131
.ifPresent (apiResponse1 ::content );
134
132
AnnotationsUtils .getHeaders (apiResponse2 .headers (), null ).ifPresent (apiResponse1 ::headers );
135
133
apiResponsesOp .addApiResponse (apiResponse2 .responseCode (), apiResponse1 );
@@ -221,8 +219,7 @@ private void setContent(String[] methodProduces, Content content,
221
219
222
220
private Schema calculateSchema (Components components , ParameterizedType parameterizedType ) {
223
221
Schema schemaN ;
224
- schemaN = AnnotationsUtils .resolveSchemaFromType ((Class <?>) parameterizedType .getActualTypeArguments ()[0 ], null ,
225
- null );
222
+ schemaN = SpringDocAnnotationsUtils .extractSchema (components , parameterizedType .getActualTypeArguments ()[0 ]);
226
223
if (schemaN .getType () == null ) {
227
224
schemaN = SpringDocAnnotationsUtils .extractSchema (components ,
228
225
parameterizedType .getActualTypeArguments ()[0 ]);
0 commit comments