You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's impossible as of now to have any validation while constructing the public structs (e.g. Payment, Login, etc). For instance, if I wish to have a bool attribute that have the default value true I can't do it. That's because we are using the built-in new function to initialize some public structs.
We should create custom "constructors", e.g., NewPayment(...) as a way to have a better code encapsulation and maintainability. Here are a good reference of how to do it.
⚠️ This is a breaking change on the library.
Evidence
This PR has an example of the mentioned problem around bool default value.
The text was updated successfully, but these errors were encountered:
Description
It's impossible as of now to have any validation while constructing the public structs (e.g. Payment, Login, etc). For instance, if I wish to have a
bool
attribute that have the default valuetrue
I can't do it. That's because we are using the built-innew
function to initialize some public structs.We should create custom "constructors", e.g.,
NewPayment(...)
as a way to have a better code encapsulation and maintainability. Here are a good reference of how to do it.Evidence
This PR has an example of the mentioned problem around
bool
default value.The text was updated successfully, but these errors were encountered: