viniciussanchez / dataset-serialize

JSON to DataSet and DataSet to JSON converter for Delphi and Lazarus (FPC)
MIT License
653 stars 161 forks source link

How to do if in the Json we have '_' char in the fieldname ? #204

Closed mlcvista closed 1 year ago

mlcvista commented 1 year ago

Hello, I've notice that if the fieldname have '_' inside, the LoadFromJSON seems to put null to the value even if it is not null... Sample : [ { "code_site": "B065", "codestation": "DF1001", "grandeur_hydro": "H", "date_debut_serie": "2023-08-31T00:00:01Z", "date_fin_serie": "2023-08-31T07:30:00Z", "statut_serie": 8, "code_systeme_alti_serie": 71, "date_obs": "2023-08-31T07:30:00Z", "resultat_obs": -105.0, "code_methode_obs": 0, "libelle_methode_obs": "Mesure", "code_qualification_obs": 11, "libelle_qualification_obs": "Aucune", "continuite_obs_hydro": true, "longitude": 8.167182801, "latitude": 22.677129815 } ]

"code_site": return null... "codestation": return 'DF1001'... "grandeur_hydro": return null...

I've test it with dataset-serialize- sample (basic), with the Load empty Dataset... I don't see what's wrong...

With best regards, Mike.

mlcvista commented 1 year ago

Seems i've found the solution: TDataSetSerializeConfig.GetInstance.CaseNameDefinition := TCaseNameDefinition(4);

Big thank you for your very good and powerful dataset-serialize ! With best regards, Mike

viniciussanchez commented 1 year ago

Thanks \o/