File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/jvmTest/kotlin/it/krzeminski/githubactionstyping Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import io.kotest.matchers.should
7
7
import io.kotest.matchers.shouldNot
8
8
import io.kotest.mpp.sysprop
9
9
import it.krzeminski.snakeyaml.engine.kmp.api.Load
10
+ import it.krzeminski.snakeyaml.engine.kmp.api.LoadSettings
11
+ import it.krzeminski.snakeyaml.engine.kmp.schema.CoreSchema
10
12
import kotlinx.serialization.json.JsonArray
11
13
import kotlinx.serialization.json.JsonElement
12
14
import kotlinx.serialization.json.JsonNull
@@ -46,7 +48,15 @@ private fun beValid(): Matcher<File> {
46
48
var errorMessage: String? = null
47
49
MatcherResult (
48
50
runCatching {
49
- schema.validate(dataFile.inputStream().use { Load ().loadOne(it) }.toJsonElement()) {
51
+ schema.validate(dataFile.inputStream().use {
52
+ Load (
53
+ // work-around for https://github.com/krzema12/snakeyaml-engine-kmp/pull/390
54
+ // Per https://yaml.org/spec/1.2.2/#recommended-schemas, the Core Schema is
55
+ // the recommended default schema that YAML processor should use unless
56
+ // instructed otherwise.
57
+ LoadSettings .builder().setSchema(CoreSchema ()).build()
58
+ ).loadOne(it)
59
+ }.toJsonElement()) {
50
60
errorMessage = buildString {
51
61
if (errorMessage != null ) {
52
62
appendLine(errorMessage)
You can’t perform that action at this time.
0 commit comments