From e7d3a791ba609b130fcd1ff7973556ae0ced2689 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 2 Apr 2023 00:03:56 +0200 Subject: [PATCH] CHANGELOG.md prepare for version 2.1.0 --- CHANGELOG.md | 32 +++++++++++++++++++ .../SpringDocSecurityOAuth2Customizer.java | 9 +++--- .../providers/SpringDocJavadocProvider.java | 2 +- .../core/service/AbstractRequestService.java | 1 - 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 987900f08..72473564c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,38 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.1.0] - 2023-04-01 + +### Added + +- #2152 - Detect directions in default sort values +- #2167 #2166 - Add request parameter for token endpoint +- #2188 - Support of {*param} path patterns + +### Changed + +- Upgrade spring-boot to 3.0.5 +- Upgrade swagger-core to 2.2.9 +- Upgrade swagger-ui to 4.18.2 +- Spring Native is now superseded by Spring Boot 3 official +- #2173 - Remove webjars-locator-core + +### Fixed + +- #2122 - Super tiny fix typo +- #2131 - Fixed a bug that javadoc of record class parameters was not recognized. +- #2140 - Javadoc record class parameters not recognized +- #2123 #2141 - fix spring authorization server response. +- #2148 - Fix properties show-oauth2-endpoints and SpringDocConfigProperties#showOauth2Endpoint properties name mismatch +- #2149 - Request parameters with default values are marked as required. +- #2155 - openApi.getServers() is null in OpenApiCustomiser when using different locales. +- #2152 - Redundant(wrong) direction appended to @PageableDefault. +- #2181 #2183 - Fixed DefaultFlatParamObject to work with annotated parameters. +- #2170 #2187 - All request parameters marked as required for Java controllers in mixed projects in 2.0.3 +- #2165 - Custom Converters are not excluded if not registered for Http Message Converter. +- #2185 - Fix behaviour of required flag for schema class fields. +- #2139 - SpringDocSecurityConfiguration class not sufficiently constrained. +- #2142 - SpringDocJacksonModuleConfiguration is loaded even though there is no ObjectMapperProvider when springdoc.api-docs.enabled = false. ## [2.0.4] - 2023-03-15 diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java index 4013571e5..159e6dea1 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityOAuth2Customizer.java @@ -2,6 +2,7 @@ import java.lang.reflect.Field; +import io.swagger.v3.core.util.AnnotationsUtils; import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; @@ -125,7 +126,7 @@ private void getOAuth2TokenIntrospectionEndpointFilter(OpenAPI openAPI, Security new SpringDocSecurityOAuth2EndpointUtils(OAuth2TokenIntrospectionEndpointFilter.class).findEndpoint(securityFilterChain); if (oAuth2EndpointFilter != null) { ApiResponses apiResponses = new ApiResponses(); - buildApiResponsesOnSuccess(apiResponses, SpringDocAnnotationsUtils.resolveSchemaFromType(SpringDocOAuth2TokenIntrospection.class, openAPI.getComponents(), null)); + buildApiResponsesOnSuccess(apiResponses, AnnotationsUtils.resolveSchemaFromType(SpringDocOAuth2TokenIntrospection.class, openAPI.getComponents(), null)); buildApiResponsesOnInternalServerError(apiResponses); buildApiResponsesOnBadRequest(apiResponses, openAPI); @@ -153,7 +154,7 @@ private void getOAuth2AuthorizationServerMetadataEndpoint(OpenAPI openAPI, Secur new SpringDocSecurityOAuth2EndpointUtils(OAuth2AuthorizationServerMetadataEndpointFilter.class).findEndpoint(securityFilterChain); if (oAuth2EndpointFilter != null) { ApiResponses apiResponses = new ApiResponses(); - buildApiResponsesOnSuccess(apiResponses, SpringDocAnnotationsUtils.resolveSchemaFromType(SpringDocOAuth2AuthorizationServerMetadata.class, openAPI.getComponents(), null)); + buildApiResponsesOnSuccess(apiResponses, AnnotationsUtils.resolveSchemaFromType(SpringDocOAuth2AuthorizationServerMetadata.class, openAPI.getComponents(), null)); buildApiResponsesOnInternalServerError(apiResponses); Operation operation = buildOperation(apiResponses); buildPath(oAuth2EndpointFilter, "requestMatcher", openAPI, operation, HttpMethod.GET); @@ -199,7 +200,7 @@ private void getOAuth2TokenEndpoint(OpenAPI openAPI, SecurityFilterChain securit if (oAuth2EndpointFilter != null) { ApiResponses apiResponses = new ApiResponses(); - buildApiResponsesOnSuccess(apiResponses, SpringDocAnnotationsUtils.resolveSchemaFromType(SpringDocOAuth2Token.class, openAPI.getComponents(), null)); + buildApiResponsesOnSuccess(apiResponses, AnnotationsUtils.resolveSchemaFromType(SpringDocOAuth2Token.class, openAPI.getComponents(), null)); buildApiResponsesOnInternalServerError(apiResponses); buildApiResponsesOnBadRequest(apiResponses, openAPI); buildOAuth2Error(openAPI, apiResponses, HttpStatus.UNAUTHORIZED); @@ -317,7 +318,7 @@ private ApiResponses buildApiResponsesOnBadRequest(ApiResponses apiResponses, Op * @param httpStatus the http status */ private static void buildOAuth2Error(OpenAPI openAPI, ApiResponses apiResponses, HttpStatus httpStatus) { - Schema oAuth2ErrorSchema = SpringDocAnnotationsUtils.resolveSchemaFromType(OAuth2Error.class, openAPI.getComponents(), null); + Schema oAuth2ErrorSchema = AnnotationsUtils.resolveSchemaFromType(OAuth2Error.class, openAPI.getComponents(), null); apiResponses.addApiResponse(String.valueOf(httpStatus.value()), new ApiResponse().description(httpStatus.getReasonPhrase()).content(new Content().addMediaType( APPLICATION_JSON_VALUE, new MediaType().schema(oAuth2ErrorSchema)))); diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocJavadocProvider.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocJavadocProvider.java index b2609861a..8ebfc1905 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocJavadocProvider.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/providers/SpringDocJavadocProvider.java @@ -76,7 +76,7 @@ public String getClassJavadoc(Class cl) { public Map getRecordClassParamJavadoc(Class cl) { ClassJavadoc classJavadoc = RuntimeJavadoc.getJavadoc(cl); return classJavadoc.getRecordComponents().stream() - .collect(Collectors.toMap(ParamJavadoc::getName, record -> formatter.format(record.getComment()))); + .collect(Collectors.toMap(ParamJavadoc::getName, recordClass -> formatter.format(recordClass.getComment()))); } /** diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java index 5f015f03d..59cdfc4d9 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java @@ -516,7 +516,6 @@ public Parameter buildParams(ParameterInfo parameterInfo, Components components, // By default if (!isRequestBodyParam(requestMethod, parameterInfo, openApiVersion)) { parameterInfo.setRequired(!((DelegatingMethodParameter) methodParameter).isNotRequired() && !methodParameter.isOptional()); - //parameterInfo.setParamType(QUERY_PARAM); parameterInfo.setDefaultValue(null); return this.buildParam(parameterInfo, components, jsonView); }