Releases: charleskorn/kaml
0.28.0
- Updated: Upgrade to kotlinx.serialization 1.1.
Note that GitHub Actions is now used to build kaml. As part of this transition, a new GPG key (E01ED293981AE484403B65D7DA70BCBA6D76AD03
) has been used to sign this release and will be used for all future releases.
0.27.0
What's changed
- Updated: kaml is now built against Kotlin 1.4.30 and SnakeYAML 2.2.1.
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.27.0")
For other tools, refer to the Maven Central release page for more information.
0.26.0
What's changed
- Changed:
⚠️ Potentially breaking change:YamlException
now inherits fromSerializationException
, notRuntimeException
(#57 - thanks to @NiematojakTomasz for the feedback) - Updated: kaml is now built against kotlinx-serialization 1.0.1.
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.26.0")
For other tools, refer to the Maven Central release page for more information.
0.25.0
What's changed
- New:
YamlMap
now has agetKey()
method that returns theYamlScalar
for the given key in the map. - Updated: kaml is now built against kotlinx-serialization 1.0.0.
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.25.0")
For other tools, refer to the Maven Central release page for more information.
0.24.0
What's changed
-
New: all exceptions thrown during parsing now have the concept of a path, which shows the route taken to get to the location of the error. This makes it much easier to understand where an error is located, especially when merging or aliases are involved. (#37 - thanks to @Vampire for the issue report)
For example, given the following input YAML:
colours: - name: primary r: 100 g: 200 b: 203
If the value
primary
is invalid forname
, the exception would include the pathcolours[0].name
.The path in included in
toString()
for all exceptions. -
Improved: the error message shown when an object has multiple merges (
<<
keys) has been clarified. -
Improved:
YamlNode
and subclasses now have a much clearertoString()
output, which should make debugging custom deserializers much easier. -
⚠️ Breaking change:YamlMap
now only allows scalars as keys. This should not impact most users as decoding a YAML map with non-scalar keys previously threw an exception anyway.
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.24.0")
For other tools, refer to the Maven Central release page for more information.
0.23.0
What's changed
-
New: it is now possible to customise the property name used when encoding and decoding polymorphic types, similar to the
classDiscriminator
option for kotlinx-serialization's built-in JSON format (#47 - thanks to @ChanTsune for the PR)Set
YamlConfiguration.polymorphismPropertyName
to configure this. The default value istype
to preserve the existing default behaviour.
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.23.0")
For other tools, refer to the Maven Central release page for more information.
0.22.0
What's changed
- Updated: kaml is now built with Kotlin 1.4.10.
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.22.0")
For other tools, refer to the Maven Central release page for more information.
0.21.0
What's changed
-
New: it is now possible to configure the style for emitted lists and sequences by setting
YamlConfiguration.sequenceStyle
(#40 - thanks to @knightzmc for the suggestion and PR)For example, for the list
1, 2, 3
, block style (which was the previous behaviour and is still the default) would emit the list as:- 1 - 2 - 3
And in flow style, it would be emitted as:
[1, 2, 3]
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.21.0")
For other tools, refer to the Maven Central release page for more information.
0.20.0
What's changed
-
New:
YamlMap
now hasget(key)
andgetScalar(key)
methods that return the YAML node or scalar value (respectively) in the map forkey
(#32 - thanks to @Vampire for the suggestion) -
New: it is now possible to change the indentation level and maximum scalar value width when encoding values to YAML (#33 - thanks to @Vampire for the suggestion)
Set
encodingIndentationSize
orbreakScalarsAt
onYamlConfiguration
to alter the default values (indent by two spaces, and split scalars onto a new line at 80 characters). -
New: calling
toString()
on an exception now includes line and column numbers in the result, for example:com.charleskorn.kaml.YamlException at line 123, column 456: Something went wrong
(#36 - thanks to @Vampire for the suggestion) -
Changed:
⚠️ Potentially breaking change: Kotlin 1.4's explicit API mode has been enabled. Some internal APIs that were previously exposed are now correctly marked asinternal
.If you were relying on these previously public APIs, please file an issue explaining your use case.
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.20.0")
For other tools, refer to the Maven Central release page for more information.
0.19.0
What's changed
-
Updated: kaml is built against Kotlin 1.4 and kotlinx.serialization 1.0.0-RC.
⚠️ Potentially breaking change: Note that this introduces two breaking changes to maintain consistency with the built-in formats and theStringFormat
interface:Yaml.parse()
is nowYaml.decodeFromString()
Yaml.stringify()
is nowYaml.encodeToString()
Upgrading
If you're using Gradle, reference kaml in your dependencies
block like this:
implementation("com.charleskorn.kaml:kaml:0.19.0")
For other tools, refer to the Maven Central release page for more information.