kotlinx.serialization icon indicating copy to clipboard operation
kotlinx.serialization copied to clipboard

Ignore unknown keys per class / via annotation

Open sschuberth opened this issue 4 years ago • 2 comments

What is your use-case and why do you need this feature?

I know keys can be ignored "globally" on the JSON builder scope. But for safely, and to better document which classes have been implemented completely and which not, I'd prefer to ignore unknown keys per class only.

Describe the solution you'd like

I'd prefer an annotation-based solution, similar to Jackson's @JsonIgnoreProperties(ignoreUnknown = true) annotation.

sschuberth avatar Apr 18 '21 16:04 sschuberth

any update?

Its very critial for scalability.

codeyash avatar Jun 03 '23 08:06 codeyash

Yeah there are many major APIs were forced to use which version their API contracts publicly but still randomly permute certain sub objects.

ixtli avatar Oct 14 '24 17:10 ixtli