You can store JSON blobs in text attributes. You can then read them directly as JSON (variable := attribute_name::JSON) within your backend functions to use regular JSON functions for reading or editing parts of it. The same on the frontend: Send it as text and then parse it as JSON with JSON.parse() in Javascript.