Why can "class", "metaClass" and "declaringClass" not be used as keys in JSON-lib? Why can "class", "metaClass" and "declaringClass" not be used as keys in JSON-lib? json json

Why can "class", "metaClass" and "declaringClass" not be used as keys in JSON-lib?


According to the source code:

Exclude bean properties and/or map keys when serailizing to JSON (default=['class','metaClass','declaringClass'])

Those are bean properties that you don't want to serialize when converting an object to JSON. Besides, there are methods that you can use to include those properties in the resulting JSON.