@@ -151,14 +151,14 @@ private void buildContentFromDoc(Components components, ApiResponses apiResponse
151
151
io .swagger .v3 .oas .annotations .responses .ApiResponse apiResponseAnnotations , ApiResponse apiResponse ,
152
152
io .swagger .v3 .oas .annotations .media .Content [] contentdoc ) {
153
153
Optional <Content > optionalContent = SpringDocAnnotationsUtils .getContent (contentdoc , new String [0 ],
154
- methodAttributes .getAllProduces (), null , components , methodAttributes .getJsonViewAnnotation ());
154
+ methodAttributes .getMethodProduces (), null , components , methodAttributes .getJsonViewAnnotation ());
155
155
if (apiResponsesOp .containsKey (apiResponseAnnotations .responseCode ())) {
156
156
// Merge with the existing content
157
157
Content existingContent = apiResponsesOp .get (apiResponseAnnotations .responseCode ()).getContent ();
158
158
if (optionalContent .isPresent () && existingContent != null ) {
159
159
Content newContent = optionalContent .get ();
160
160
if (methodAttributes .isMethodOverloaded ()) {
161
- Arrays .stream (methodAttributes .getAllProduces ()).filter (mediaTypeStr -> (newContent .get (mediaTypeStr ) != null )).forEach (mediaTypeStr -> mergeSchema (existingContent , newContent .get (mediaTypeStr ).getSchema (), mediaTypeStr ));
161
+ Arrays .stream (methodAttributes .getMethodProduces ()).filter (mediaTypeStr -> (newContent .get (mediaTypeStr ) != null )).forEach (mediaTypeStr -> mergeSchema (existingContent , newContent .get (mediaTypeStr ).getSchema (), mediaTypeStr ));
162
162
apiResponse .content (existingContent );
163
163
}
164
164
else
@@ -273,7 +273,7 @@ private void buildApiResponses(Components components, Method method, ApiResponse
273
273
// No documentation
274
274
if (StringUtils .isBlank (apiResponse .get$ref ())) {
275
275
if (apiResponse .getContent () == null ) {
276
- Content content = buildContent (components , method , methodAttributes .getAllProduces (),
276
+ Content content = buildContent (components , method , methodAttributes .getMethodProduces (),
277
277
methodAttributes .getJsonViewAnnotation ());
278
278
apiResponse .setContent (content );
279
279
}
@@ -290,8 +290,8 @@ else if (CollectionUtils.isEmpty(apiResponse.getContent())) {
290
290
Content existingContent = apiResponse .getContent ();
291
291
Schema <?> schemaN = calculateSchema (components , method .getGenericReturnType (),
292
292
methodAttributes .getJsonViewAnnotation ());
293
- if (schemaN != null && ArrayUtils .isNotEmpty (methodAttributes .getAllProduces ())) {
294
- Arrays .stream (methodAttributes .getAllProduces ()).forEach (mediaTypeStr -> mergeSchema (existingContent , schemaN , mediaTypeStr ));
293
+ if (schemaN != null && ArrayUtils .isNotEmpty (methodAttributes .getMethodProduces ())) {
294
+ Arrays .stream (methodAttributes .getMethodProduces ()).forEach (mediaTypeStr -> mergeSchema (existingContent , schemaN , mediaTypeStr ));
295
295
}
296
296
}
297
297
apiResponsesOp .addApiResponse (httpCode , apiResponse );
0 commit comments