Skip to content

Commit

Permalink
CHANGELOG.md prepare for version 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bnasslahsen committed Apr 1, 2023
1 parent 576c00e commit e7d3a79
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public String getClassJavadoc(Class<?> cl) {
public Map<String, String> 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())));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e7d3a79

Please sign in to comment.