Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loads appears to ignore with_load params #157

Open
paulmakepeace opened this issue Feb 28, 2022 · 0 comments
Open

loads appears to ignore with_load params #157

paulmakepeace opened this issue Feb 28, 2022 · 0 comments

Comments

@paulmakepeace
Copy link

I'm sure I'm doing something wrong but...

from dataclasses import dataclass
import jsons
import json

@dataclass
class Car(jsons.JsonSerializable.with_load(
    key_transformer=jsons.KEY_TRANSFORMER_SNAKECASE
)):
  service_url: str

car = Car.loads(json.dumps({"serviceUrl":"url"})) # 💥
car = Car.loads(json.dumps({"serviceUrl":"url"}), key_transformer=jsons.KEY_TRANSFORMER_SNAKECASE) # ✅
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant