This has been moved to framework in https://github.com/ppy/osu-framework/pull/4285.
Also fixes circular references when using IJsonSerializable.