From 1cc8d853edf2fb44df62712df17f40226c0db45a Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Sun, 2 Apr 2023 00:01:05 +0200 Subject: [PATCH] CHANGELOG.md prepare for 1.7.0 --- CHANGELOG.md | 31 +++++++++++++++++++ .../core/AbstractRequestService.java | 1 - .../javadoc/SpringDocJavadocProvider.java | 2 +- .../SpringDocSecurityOAuth2Customizer.java | 10 +++--- 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f2c98d32..04849b814 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,37 @@ 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). +## [1.7.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 2.7.10 +- 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. + ## [1.6.15] - 2023-03-07 ### Added diff --git a/springdoc-openapi-common/src/main/java/org/springdoc/core/AbstractRequestService.java b/springdoc-openapi-common/src/main/java/org/springdoc/core/AbstractRequestService.java index 40d3b34e0..183ac04e5 100644 --- a/springdoc-openapi-common/src/main/java/org/springdoc/core/AbstractRequestService.java +++ b/springdoc-openapi-common/src/main/java/org/springdoc/core/AbstractRequestService.java @@ -492,7 +492,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); } diff --git a/springdoc-openapi-javadoc/src/main/java/org/springdoc/openapi/javadoc/SpringDocJavadocProvider.java b/springdoc-openapi-javadoc/src/main/java/org/springdoc/openapi/javadoc/SpringDocJavadocProvider.java index a4a39fa38..80872c93b 100644 --- a/springdoc-openapi-javadoc/src/main/java/org/springdoc/openapi/javadoc/SpringDocJavadocProvider.java +++ b/springdoc-openapi-javadoc/src/main/java/org/springdoc/openapi/javadoc/SpringDocJavadocProvider.java @@ -75,7 +75,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-security/src/main/java/org/springdoc/security/SpringDocSecurityOAuth2Customizer.java b/springdoc-openapi-security/src/main/java/org/springdoc/security/SpringDocSecurityOAuth2Customizer.java index 4f78e8649..238b815ee 100644 --- a/springdoc-openapi-security/src/main/java/org/springdoc/security/SpringDocSecurityOAuth2Customizer.java +++ b/springdoc-openapi-security/src/main/java/org/springdoc/security/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; @@ -22,7 +23,6 @@ import org.apache.commons.lang3.reflect.FieldUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springdoc.core.SpringDocAnnotationsUtils; import org.springdoc.core.customizers.GlobalOpenApiCustomizer; import org.springdoc.security.oauth2.SpringDocOAuth2AuthorizationServerMetadata; import org.springdoc.security.oauth2.SpringDocOAuth2Token; @@ -125,7 +125,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 +153,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 +199,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 +317,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))));