Skip to content

Commit f0be53e

Browse files
committed
code review
1 parent a6ea996 commit f0be53e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

springdoc-openapi-security/src/main/java/org/springdoc/security/SpringDocSecurityOAuth2Customizer.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private void getOAuth2AuthorizationServerMetadataEndpoint(OpenAPI openAPI, Secur
143143
Object oAuth2EndpointFilter =
144144
new SpringDocSecurityOAuth2EndpointUtils(OAuth2AuthorizationServerMetadataEndpointFilter.class).findEndpoint(securityFilterChain);
145145
if (oAuth2EndpointFilter != null) {
146-
ApiResponses apiResponses = buildApiResponses(SpringDocAnnotationsUtils.resolveSchemaFromType(OAuth2AuthorizationServerMetadata.class, openAPI.getComponents(), null), openAPI);
146+
ApiResponses apiResponses = buildApiResponses(SpringDocAnnotationsUtils.resolveSchemaFromType(OAuth2AuthorizationServerMetadata.class, openAPI.getComponents(), null));
147147
Operation operation = buildOperation(apiResponses);
148148
buildPath(oAuth2EndpointFilter, "requestMatcher", openAPI, operation, HttpMethod.GET);
149149
}
@@ -159,7 +159,7 @@ private void getNimbusJwkSetEndpoint(OpenAPI openAPI, SecurityFilterChain securi
159159
Object oAuth2EndpointFilter =
160160
new SpringDocSecurityOAuth2EndpointUtils(NimbusJwkSetEndpointFilter.class).findEndpoint(securityFilterChain);
161161
if (oAuth2EndpointFilter != null) {
162-
ApiResponses apiResponses = buildApiResponses(SpringDocAnnotationsUtils.resolveSchemaFromType(JWKSet.class, openAPI.getComponents(), null), openAPI);
162+
ApiResponses apiResponses = buildApiResponses(SpringDocAnnotationsUtils.resolveSchemaFromType(JWKSet.class, openAPI.getComponents(), null));
163163
Operation operation = buildOperation(apiResponses);
164164
operation.responses(apiResponses);
165165
buildPath(oAuth2EndpointFilter, "requestMatcher", openAPI, operation, HttpMethod.GET);
@@ -224,10 +224,9 @@ private Operation buildOperation(ApiResponses apiResponses) {
224224
* Build api responses api responses.
225225
*
226226
* @param schema the schema
227-
* @param openAPI the open api
228227
* @return the api responses
229228
*/
230-
private ApiResponses buildApiResponses(Schema schema, OpenAPI openAPI) {
229+
private ApiResponses buildApiResponses(Schema schema) {
231230
ApiResponses apiResponses = new ApiResponses();
232231
ApiResponse response = new ApiResponse().description(HttpStatus.OK.getReasonPhrase()).content(new Content().addMediaType(
233232
APPLICATION_JSON_VALUE,
@@ -245,7 +244,7 @@ private ApiResponses buildApiResponses(Schema schema, OpenAPI openAPI) {
245244
* @return the api responses
246245
*/
247246
private ApiResponses buildApiResponsesWithBadRequest(Schema schema, OpenAPI openAPI) {
248-
ApiResponses apiResponses = buildApiResponses(schema, openAPI);
247+
ApiResponses apiResponses = buildApiResponses(schema);
249248
buildOAuth2Error(openAPI, apiResponses, HttpStatus.BAD_REQUEST);
250249
return apiResponses;
251250
}

0 commit comments

Comments
 (0)