kaml icon indicating copy to clipboard operation
kaml copied to clipboard

Interoperability with `JsonElement`

Open sschuberth opened this issue 1 month ago • 0 comments

Describe the problem you'd like to solve

There are several third-party libraries, like https://github.com/optimumcode/json-schema-validator/, that take a JsonElement. Such libraries are currently not usable with Kaml, which uses its own YamlNode (and generally seems to "reinvent" even those data types that are available in JSON, too).

Describe the solution you'd like

As in many cases YAML is mapable to JSON, it would be nice if there was e.g. a YamlNode.toJsonElement() function that does exactly that, and throws if a conversion to a corresponding JSON structure is not possible.

Describe alternatives you've considered

No response

Additional context

I would like to validate YAML configuration files against JSON schema definitions.

sschuberth avatar Nov 11 '25 12:11 sschuberth