charleskorn / kaml

YAML support for kotlinx.serialization
Apache License 2.0
490 stars 47 forks source link

Correct handling of `SerialKind.CONTEXTUAL` in `YamlInput` class #582

Closed OptimumCode closed 2 weeks ago

OptimumCode commented 2 weeks ago

Hi, @charleskorn.

This PR corrects how YamlInput handles the serialization of fields marked with @Contextual annotation. Instead of forcing the serializer to call beginStructure it extracts the actual definition and creates the appropriate YamlInput based on that definition where applicable.

Please, take a look at the PR once you have time. Let me know if you have any remarks/suggestions regarding the change

Resolves #568