Skip to content

Commit 1fc350c

Browse files
authored
fix(dsl): support serializing Double (#1485)
1 parent 05767c3 commit 1fc350c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

github-workflows-kt/src/main/kotlin/io/github/typesafegithub/workflows/yaml/ObjectToYaml.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private fun Any?.elementToYaml(emitter: Emitter) {
4545
when (this) {
4646
is Map<*, *> -> this.mapToYaml(emitter)
4747
is List<*> -> this.listToYaml(emitter)
48-
is String, is Int, is Float, is Boolean, null -> this.scalarToYaml(emitter)
48+
is String, is Int, is Float, is Double, is Boolean, null -> this.scalarToYaml(emitter)
4949
else -> error("Serializing $this is not supported!")
5050
}
5151
}

github-workflows-kt/src/test/kotlin/io/github/typesafegithub/workflows/yaml/ObjectToYamlTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class ObjectToYamlTest : DescribeSpec({
3333
"bar",
3434
123,
3535
456.789f,
36+
11.22,
3637
listOf(
3738
mapOf("another-foo" to 123),
3839
mapOf("key-with-null-value" to null),
@@ -54,6 +55,7 @@ class ObjectToYamlTest : DescribeSpec({
5455
- 'bar'
5556
- 123
5657
- 456.789
58+
- 11.22
5759
- - another-foo: 123
5860
- key-with-null-value: null
5961
- key-with-null-map: {}

0 commit comments

Comments
 (0)