Skip to content

Add get_member_name to serializable interface

Currently, GObject serialization always uses the property name from the GParamSpec.

However, GParamSpecs have name restrictions that JSON doesn't have, so if you are using json-glib to serialize to an existing JSON format that isn't under the control of the developer, there's no way to customize what the property name is in the resulting JSON.

As an example, if you want the property name "this_is_foo", thanks to GParamSpec, you will always serialize "this-is-foo".

This works around that restriction by allowing the developer to specify what the member name should be for a given property.

Merge request reports