We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Instead of directly accessing json, you could define a few helper dataclasses or pydantic models:
cscs-keygen/utils.py
Line 59 in 20b8c48
The text was updated successfully, but these errors were encountered:
You're suggesting something like the following?
from pydantic import BaseModel class KeyResponse(BaseModel): public: str private: str response_model = KeyResponse.model_validate(response.content.decode()) pub_key = response_model.public priv_key = response_model.private
Sorry, something went wrong.
Yes, correct. I think it's a bit safer and slightly more ergonomic
No branches or pull requests
Instead of directly accessing json, you could define a few helper dataclasses or pydantic models:
cscs-keygen/utils.py
Line 59 in 20b8c48
The text was updated successfully, but these errors were encountered: