Skip to content

Commit

Permalink
Upgrade to SnakeYAML 2.0
Browse files Browse the repository at this point in the history
Closes gh-35982
  • Loading branch information
wilkinsona committed Jun 19, 2023
1 parent a94ac2f commit 1f9ce50
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 32 deletions.
2 changes: 1 addition & 1 deletion spring-boot-project/spring-boot-dependencies/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ bom {
]
}
}
library("SnakeYAML", "1.33") {
library("SnakeYAML", "2.0") {
group("org.yaml") {
modules = [
"snakeyaml"
Expand Down
11 changes: 11 additions & 0 deletions spring-boot-project/spring-boot-docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ configurations {
remoteSpringApplicationExample
springApplicationExample
testSlices
asciidoctorExtensions {
resolutionStrategy {
eachDependency { dependency ->
// Downgrade SnakeYAML as Asciidoctor fails due to an incompatibility
// in the Pysch gem
if (dependency.requested.group.equals("org.yaml")) {
dependency.useVersion("1.33")
}
}
}
}
}

jar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.yaml.snakeyaml.constructor.ConstructorException;
import org.yaml.snakeyaml.composer.ComposerException;

import org.springframework.boot.origin.OriginTrackedValue;
import org.springframework.boot.origin.TextResourceOrigin;
Expand Down Expand Up @@ -134,7 +134,7 @@ void unsupportedType() {
String yaml = "value: !!java.net.URL [!!java.lang.String [!!java.lang.StringBuilder [\"http://localhost:9000/\"]]]";
Resource resource = new ByteArrayResource(yaml.getBytes(StandardCharsets.UTF_8));
this.loader = new OriginTrackedYamlLoader(resource);
assertThatExceptionOfType(ConstructorException.class).isThrownBy(this.loader::load);
assertThatExceptionOfType(ComposerException.class).isThrownBy(this.loader::load);
}

@Test
Expand Down

This file was deleted.

0 comments on commit 1f9ce50

Please sign in to comment.