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

Determine where semantics of fields will be validated #39

Open
andresuribe87 opened this issue Dec 8, 2023 · 0 comments
Open

Determine where semantics of fields will be validated #39

andresuribe87 opened this issue Dec 8, 2023 · 0 comments

Comments

@andresuribe87
Copy link

Structs like what was added in #37 allow consumers of this SDK to parse any JSON message or resource that's part of tbdex. Some fields in a message are strings that are meant to represent numbers. As stated in #37 (comment) there seems to be a need to validate that the values of certain fields. For example, and "amount" fields should likely only have possible amount values, even thought it's serialized as a string in JSON.

Importantly, @amika-sq mentions that

One thing I do want to mention though is that tbDEX messages/resources will need to traverse the language boundary from Rust -> other foreign languages. Strings work really well in this regard, third-party crate types not so much.

It's definitely going to be some tradeoffs, but I think we can find a happy medium here. Looking forward to discussing this more!

@amika-sq , would you be able to elaborate on what the constraints are when passing around structs between language boundaries?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant