For now the keypath concept is entirely static, meaning that you cannot translate a keypath to a string or a string to a keypath.
Have you looked at the Codable concepts for reading and writing to json?
Codable is extremely powerful and let’s you encode to and decode from json with very little code.