Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/#2932-spring-boot-2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dilipkrish committed Jan 6, 2020
2 parents 42b8900 + 2af84cd commit 6f15b63
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class BuildInfoFactory {
def isReleaseBuild = project.gradle.startParameter.taskNames.contains("release")

SemanticVersion buildVersion = versioningStrategy.buildVersion(releaseType, isReleaseBuild)
project.logger.lifecycle("[RELEASE] current verison: ${versioningStrategy.current(project)}, " +
project.logger.lifecycle("[RELEASE] current version: ${versioningStrategy.current(project)}, " +
"build version: $buildVersion, dryRun: $dryRun, releaseBuild: $isReleaseBuild")
new BuildInfo(
versioningStrategy.current(project),
Expand Down
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ext {
equalsverifierVersion = '3.1.5'
groovy = "2.5.4"
jacocoVersion = '0.8.5'
jackson = '2.10.0'
jackson = '2.10.1'
joda = "2.10.1"
jsonPath = "2.4.0"
jsonAssert = "1.5.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import springfox.documentation.spi.service.OperationBuilderPlugin;
import springfox.documentation.spi.service.contexts.OperationContext;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
Expand Down Expand Up @@ -110,7 +109,7 @@ protected Set<ResponseMessage> read(OperationContext context) {

private Function<Resource, RawHttpResponse<Void>> toRawHttpResponse() {
return resource -> {
try (InputStream resourceAsStream = new FileInputStream(resource.getFile())) {
try (InputStream resourceAsStream = resource.getInputStream()) {
RawHttp rawHttp = new RawHttp();
// must extract the body before the stream is closed
return (RawHttpResponse<Void>) rawHttp.parseResponse(resourceAsStream).eagerly();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import static org.springframework.util.StringUtils.*;

public class DescriptionResolver {
private static final Pattern PATTERN = Pattern.compile("\\Q${\\E(.+?)\\Q}\\E");
private static final Pattern PATTERN = Pattern.compile("\\Q${\\E(.+?)(:(.*))?\\Q}\\E");
private final Environment environment;
private Map<String, String> cache;

Expand Down Expand Up @@ -69,6 +69,7 @@ public String resolve(String expression) {

// Store the value
String key = matcher.group(1);
String defaultValue = matcher.group(3);

// Get the value
String value = environment.getProperty(key);
Expand All @@ -82,6 +83,11 @@ public String resolve(String expression) {
// return the value
return value;

} else if (defaultValue != null) {
// use default if value not found
cache.put(expression, defaultValue);

return defaultValue;
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class DescriptionResolverSpec extends Specification {
value | key
"key1value" | '${key1}'
"key2value" | '${key2}'
"key2value" | '${key2:}'
"key2value" | '${key2:key2default}'
"key3default" | '${key3:key3default}'
"" | '${key3:}'
'${unknown}' | '${unknown}'
"key1" | 'key1'
"key2" | 'key2'
Expand Down
2 changes: 1 addition & 1 deletion springfox-swagger-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ plugins {
}

ext {
swaggerUiVersion = '3.23.4'
swaggerUiVersion = '3.23.11'
swaggerUiDist = "build/libs/swagger-ui-dist.zip"
swaggerUiExplodedDir = "swagger-ui-${swaggerUiVersion}/dist/"
downloadUrl = "https://github.com/swagger-api/swagger-ui/archive/v${swaggerUiVersion}.zip"
Expand Down
6 changes: 3 additions & 3 deletions springfox-swagger-ui/src/web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ class FunctionContractSpec extends Specification implements FileAccess {
then:
response.statusCode == HttpStatus.OK

JSONAssert.assertEquals(contract, response.body, NON_EXTENSIBLE)
def bodyWithLFOnly = response.body.replaceAll("\\\\r\\\\n", "\\\\n") //Make sure if we're running on windows the line endings which are double-escaped match up with the resource file above.
JSONAssert.assertEquals(contract, bodyWithLFOnly, NON_EXTENSIBLE)
}

@Unroll
Expand Down

0 comments on commit 6f15b63

Please sign in to comment.