Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
bnasslahsen committed Mar 9, 2023
1 parent a6ea996 commit f0be53e
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private void getOAuth2AuthorizationServerMetadataEndpoint(OpenAPI openAPI, Secur
Object oAuth2EndpointFilter =
new SpringDocSecurityOAuth2EndpointUtils(OAuth2AuthorizationServerMetadataEndpointFilter.class).findEndpoint(securityFilterChain);
if (oAuth2EndpointFilter != null) {
ApiResponses apiResponses = buildApiResponses(SpringDocAnnotationsUtils.resolveSchemaFromType(OAuth2AuthorizationServerMetadata.class, openAPI.getComponents(), null), openAPI);
ApiResponses apiResponses = buildApiResponses(SpringDocAnnotationsUtils.resolveSchemaFromType(OAuth2AuthorizationServerMetadata.class, openAPI.getComponents(), null));
Operation operation = buildOperation(apiResponses);
buildPath(oAuth2EndpointFilter, "requestMatcher", openAPI, operation, HttpMethod.GET);
}
Expand All @@ -159,7 +159,7 @@ private void getNimbusJwkSetEndpoint(OpenAPI openAPI, SecurityFilterChain securi
Object oAuth2EndpointFilter =
new SpringDocSecurityOAuth2EndpointUtils(NimbusJwkSetEndpointFilter.class).findEndpoint(securityFilterChain);
if (oAuth2EndpointFilter != null) {
ApiResponses apiResponses = buildApiResponses(SpringDocAnnotationsUtils.resolveSchemaFromType(JWKSet.class, openAPI.getComponents(), null), openAPI);
ApiResponses apiResponses = buildApiResponses(SpringDocAnnotationsUtils.resolveSchemaFromType(JWKSet.class, openAPI.getComponents(), null));
Operation operation = buildOperation(apiResponses);
operation.responses(apiResponses);
buildPath(oAuth2EndpointFilter, "requestMatcher", openAPI, operation, HttpMethod.GET);
Expand Down Expand Up @@ -224,10 +224,9 @@ private Operation buildOperation(ApiResponses apiResponses) {
* Build api responses api responses.
*
* @param schema the schema
* @param openAPI the open api
* @return the api responses
*/
private ApiResponses buildApiResponses(Schema schema, OpenAPI openAPI) {
private ApiResponses buildApiResponses(Schema schema) {
ApiResponses apiResponses = new ApiResponses();
ApiResponse response = new ApiResponse().description(HttpStatus.OK.getReasonPhrase()).content(new Content().addMediaType(
APPLICATION_JSON_VALUE,
Expand All @@ -245,7 +244,7 @@ private ApiResponses buildApiResponses(Schema schema, OpenAPI openAPI) {
* @return the api responses
*/
private ApiResponses buildApiResponsesWithBadRequest(Schema schema, OpenAPI openAPI) {
ApiResponses apiResponses = buildApiResponses(schema, openAPI);
ApiResponses apiResponses = buildApiResponses(schema);
buildOAuth2Error(openAPI, apiResponses, HttpStatus.BAD_REQUEST);
return apiResponses;
}
Expand Down

0 comments on commit f0be53e

Please sign in to comment.