Skip to content

Commit 679fb4d

Browse files
committed
Add components parameter when calling AnnotationsUtils.
The swagger-core's AnnotationsUtils has added an overload of the getHeaders method. A scenario where an NPE occurs if the components is not added as an argument has emerged.
1 parent ed2cfb1 commit 679fb4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/OperationService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* *
44
* * *
55
* * * *
6-
* * * * * Copyright 2019-2022 the original author or authors.
6+
* * * * * Copyright 2019-2024 the original author or authors.
77
* * * * *
88
* * * * * Licensed under the Apache License, Version 2.0 (the "License");
99
* * * * * you may not use this file except in compliance with the License.
@@ -412,7 +412,7 @@ private Optional<ApiResponses> getApiResponses(
412412

413413
buildResponseContent(methodAttributes, components, classProduces, methodProduces, apiResponsesOp, response, apiResponseObject);
414414

415-
AnnotationsUtils.getHeaders(response.headers(), null, propertyResolverUtils.isOpenapi31()).ifPresent(apiResponseObject::headers);
415+
AnnotationsUtils.getHeaders(response.headers(), components, null, propertyResolverUtils.isOpenapi31()).ifPresent(apiResponseObject::headers);
416416
// Make schema as string if empty
417417
calculateHeader(apiResponseObject);
418418
if (isResponseObject(apiResponseObject)) {

0 commit comments

Comments
 (0)