clerk / clerk-sdk-python

52 stars 15 forks source link

serialize User object to JSON #14

Closed bvschwartz closed 1 month ago

bvschwartz commented 2 months ago

I can't find a way to serialize a User object to JSON. I would ask on discord but I'm unable to get a verified account there....

speakeasybot commented 1 month ago

Hi @bvschwartz ! You should be able to use a format such as this:

from clerk_backend_api.models.user import User

# Create a User object (replace with actual attributes)
user = User(id="12345", name="John Doe", email="johndoe@example.com")

# Serialize to JSON
user_json = user.json()