Releases: charleskorn/kaml
0.18.1
What's changed
- Fixed: using a contextual serializer as the top-level deserializer for an object could fail with errors like
Expected an object, but got a list
, orCan't decode YAML map into LIST
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.18.1")
For other tools, refer to the Maven Central release page for more information.
0.18.0
What's changed
-
New: kaml now supports working with polymorphic types where the type is specified as a
type
property in YAML (#11 - thanks to @gps for the suggestion).This means that there are now two styles available for working with polymorphic types (set
YamlConfiguration.polymorphismStyle
when creating an instance ofYaml
):-
using YAML tags to specify the type:
servers: - !<frontend> hostname: a.mycompany.com - !<backend> database: db-1
-
using a
type
property to specify the type:servers: - type: frontend hostname: a.mycompany.com - type: backend database: db-1
The fragments above could be generated with:
@Serializable sealed class Server { @SerialName("frontend") @Serializable data class Frontend(val hostname: String) @SerialName("backend") @Serializable data class Backend(val database: String) } @Serializable data class Config(val servers: List<Server>) val config = Config(listOf( Frontend("a.mycompany.com"), Backend("db-1") )) val result = Yaml.default.stringify(Config.serializer(), config) println(result)
-
-
Updated: kaml is now built against Kotlin 1.3.72.
-
Changed: clearer exceptions will now be thrown in the following cases:
- missing tag when deserializing a polymorphic type when using tags for polymorphic type information
- unknown polymorphic type in tag or
type
property - missing required property for object
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.18.0")
For other tools, refer to the Maven Central release page for more information.
0.17.0
What's changed
- Updated: kaml is now built against Kotlin 1.3.71.
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.17.0")
For other tools, refer to the Maven Central release page for more information.
0.16.1
Note: version 0.16.0 was never released due to issues with the release process.
What's changed
- Updated: kaml is now built against Kotlin 1.3.70 and kotlinx.serialization 0.20, and no longer depends on internal APIs from kotlinx.serialization (thanks to @EdwarDDay and @HeartPattern for the PRs)
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.16.1")
For other tools, refer to the Maven Central release page for more information.
0.15.0
What's changed
- Updated: kaml is now built against Kotlin 1.3.60 and kotlinx.serialization 0.14.
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.15.0")
For other tools, refer to the Maven Central release page for more information.
0.14.0
What's changed
- New: kaml now supports polymorphic serialization (#4, #7 and #10 - thanks to @frzme for the suggestion and to @EdwarDDay for the PRs to implement it)
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.14.0")
For other tools, refer to the Maven Central release page for more information.
0.13.0
What's changed
- Fixed: The issue where parsing a nullable list, map or object would fail with a
InvalidPropertyValueException
has been fixed (#6 - thanks to @Will3333 for the issue report) - Updated: kaml is now built against Kotlin 1.3.50 and kotlinx.serialization 0.12.
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.13.0")
For other tools, refer to the Maven Central release page for more information.
0.12.0
What's changed
- New: kaml now supports omitting default values from written YAML. Use a
YamlConfiguration
instance withencodeDefaults
set tofalse
to omit default values. (#3 - thanks to @bjonnh for the PR) - New: kaml now supports non-strict parsing of YAML to objects, which means it will ignore unknown fields instead of throwing an exception. Use a
YamlConfiguration
instance withstrictMode
set tofalse
to ignore unknown fields. (#5 - thanks to @fvasco for the suggestion) - Changed:
extensionDefinitionPrefix
is now a property ofYamlConfiguration
instead ofYaml
. - Updated: kaml is now built against Kotlin 1.3.41.
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.12.0")
For other tools, refer to the Maven Central release page for more information.
0.11.0
What's changed
- New: kaml will now provide a better error message when a map or list is given when a scalar value is expected or vice versa, rather than cryptic messages like
Size must be known in advance when using READ_ALL
.
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.11.0")
For other tools, refer to the Maven Central release page for more information.
0.10.0
What's changed
- Updated: kaml is now built against Kotlin 1.3.31
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.10.0")
For other tools, refer to the Maven Central release page for more information.