janis on Nostr: Not yew and wasm, but lots of Rust. Typically you deserialize directly into your ...
Not yew and wasm, but lots of Rust. Typically you deserialize directly into your type, and then maybe have an additional validation method on it if the shape is not enough.
In practice it’s not really that bad when it comes to types. You can set Serde to ignore unknown fields to deal with APIs that throw the jungle together with the monkey and the banana. But yes, if something that you need out of the API can be NULL, that should be an Option on Rust side.
But that’s a win. Right? Right? 😂😅
Published at
2023-12-29 15:10:01Event JSON
{
"id": "941014683972b681968afbfe3f99435d70b6013831721dae59603ce4842688ac",
"pubkey": "da761b4153a1844dc03ad505fc08d125d4bb054d7cf4a4fe06de3df77a45fd85",
"created_at": 1703862601,
"kind": 1,
"tags": [
[
"e",
"1c5db59df3cf4dc451f5fa0c23bcec9fa6460667663d2d97da9729d23ce9292a"
],
[
"p",
"9a4acdeb978565e27490dca65c83e9f65745eaec1d9a0405a52d198c1489913b"
]
],
"content": "Not yew and wasm, but lots of Rust. Typically you deserialize directly into your type, and then maybe have an additional validation method on it if the shape is not enough.\n\nIn practice it’s not really that bad when it comes to types. You can set Serde to ignore unknown fields to deal with APIs that throw the jungle together with the monkey and the banana. But yes, if something that you need out of the API can be NULL, that should be an Option on Rust side.\n\nBut that’s a win. Right? Right? 😂😅",
"sig": "4b5518ed1bce992b82b62f7b0486e8955b66853bc6aa2ad3280fa6bf5c09f69761187f25f63cf1b37f5b1638cf64bb5f5502443eaec71a4cf7f9e3cfc2456060"
}