You are not logged in.
Pages: 1
Hello friends,
My first post about mORMot2, I started the task of migrating to version 2, I have code like this in several files:
  // mORMot 1
  TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TMyClass), __TMyClass).Options := [soReadIgnoreUnknownFields,soWriteHumanReadable];I am trying to determine what the equivalent code would be now
  // mORMot 2
  TRttiJson.RegisterFromText(TypeInfo(TMyClass), __TMyClass, [jpoIgnoreUnknownProperty],[]);This code compiles without error but before I change all the similar lines I would like to hear your advice
Last edited by moctes (2024-12-04 18:24:56)
Offline
I am not sure jpoIgnoreUnknownProperty is mandatory, because it would depend how it is parsed.
For the SOA it is set by default - no need to add it.
Then you can use TRttiJson.RegisterFromText([ ]) with pairs - as we do in our usual code.
Offline
Thank you !
If I have more questions I will ask them in this same post.
Offline
Pages: 1