You are not logged in.
Pages: 1
AS_UNIQUE can mark a field value to be unique in the table,
but the woStoreStoredFalse option can not be set with
_ObjFast(const NameValuePairs: array of const) overload function,
therefor ,the filed marked as_unique won't be serialized ,it just missing.
i know i can use _ObjFast(aObject: TObject; aOptions: TTextWriterWriteObjectOptions = [woDontStoreDefault]) overload function,
but there are so mary scenarios _ObjFast(const NameValuePairs: array of const) comes more handy.
throuth the code ,woStoreStoredFalse is to protect some sensitive information like password,
the AS_UNIQUE should mean "unique", not "sensitive"
may be we need another marker to do so.
Offline
and with this AS_UNIQUE , when use the ctxt.Returns(const NameValuePairs: array of const;....) to return some Torm data, those filed are all missing
Offline
Offline
I am suffering a similar/related issue (mORMot2).
To use ObjectTOJSON, I have to explicitly specify ObjectToJSON(myObject, [woStoreStoredFalse]), otherwise, the object won't be correctly serialized (i.e., those AS_UNIQUE fields will be missing).
Last edited by wxinix (2021-05-18 21:18:21)
Offline
Now I understand your problem.
If you use TOrm, "stored AS_UNIQUE" is interpreted as "stored false" by ObjectToJson() so some fields are missing in the JSON.
This is indeed a bug.
I have introduced rcfDisableStored RTTI option so that TOrm "stored AS_UNIQUE" attributes are ignored during JSON serialization.
It should fix your issue.
Offline
Pages: 1