You are not logged in.
Pages: 1
Version: 4885
This JSON text can't be parsed using RecordLoadJSON function and the reader reported false assigned to wasValid
FirstChar := JSON^;
JSON := Reader(JSON,Rec,wasValid);
if not wasValid then
exit;
'{"Head":{"RECORD_AUTOINC":2,"RECORD_INDICATOR":3565564291285041560},"Account":"BA83283277F8999","BIC":"FNBOUS44","InstitutionAccount":"7770100000","FinancialAccount":"12345678901234567890","EncryptionKey":"CCCA01A25A7CF5A98109","Currency":840,"MultiCurrency":true,"CommonName":"MERCHANT.strong-data.COM","Subject":1994948748,"CASubject":1788932080,"Issuer":"Users CA","ProfileID":11}
Offline
Please don't post in the forum huge pieces of code or JSON - as stated by the forum rules.
I don't know where your 4885 version number comes from. We currently are in version 1.18.4200.
You don't give enough information.
How is your record defined?
Offline
Hello,
4485 is from this repository https://github.com/synopse/mORMot.git/trunk
Please consider this record definition: https://mega.nz/#!7wJ2hLTA!q_b9PDpj_K9g … NrqWGvGlro
Please also note that inserting the last JSON data "ProfileID" as Cardinal in any position into the record definition solved the problem.
Any JSON item not correspond to the RTTI schema should be ignored.
Regards
Offline
Would please test the attached program?
The commented text located above then "ProfileID" definition related to the TAffiliate record.
Offline
Simply commented the validation line:
FirstChar := JSON^;
JSON := Reader(JSON,Rec,wasValid);
// if not wasValid then exit;
Solved the problem which is treated as follows:
The parse continues even the current field doesn't exist in the RTTI schema (Record definition).
Would you please confirm?
Regards
Offline
By activating this option, the problem is solved soReadIgnoreUnknownFields
TTextWriter.RegisterCustomJSONSerializerSetOptions(TypeInfo(T),[soReadIgnoreUnknownFields]);
Offline
Pages: 1