Noticed that currently JSON stringify only includes the protected _id property - whereas if we want to treat the JSON as a read-only instance of some NFT NSDAL type, it needs an id, not_id. For example, with mediator if I do a getCustomer command, it should return customer JSON that includes an id, so I can still use the Customer class on the client side for property code-completion. Granted, it's not a real NSDAL object but we know on the client side because it came from plain JSON so it's obviously not a real NSDAL record. Still useful for the shape (properties).
Note I didn't try to prevent the _id field from also serializing but we certainly could. I figured that would be a bit more risky than simply adding id.
Noticed that currently JSON stringify only includes the protected
_id
property - whereas if we want to treat the JSON as a read-only instance of some NFT NSDAL type, it needs anid
, not_id
. For example, with mediator if I do agetCustomer
command, it should return customer JSON that includes anid
, so I can still use theCustomer
class on the client side for property code-completion. Granted, it's not a real NSDAL object but we know on the client side because it came from plain JSON so it's obviously not a real NSDAL record. Still useful for the shape (properties).