#1 2015-05-05 09:10:23

yankee
Member
Registered: 2015-04-08
Posts: 7

Parsing JSON fields in a TRawUTF8List

Hi,
I'm a little confused about all JSON-related functions in SynCommons.

I'm using the mORMot JSon parser "alone" because I'm creating a REST client for a custom Server (that doesn't use mORMot).

I receive a JSON response like this:

{
  outputParam1:"value1",
  outputParam2:5,
  data: [
    {//object to be mapped to a TSQLRecord},
    {//object to be mapped to a TSQLRecord},
    ...
    {//object to be mapped to a TSQLRecord}
  ]
{

I stored it in a RawUTF8 string and succesfully got the data array automatically mapped using _JsonFast and TSQLTableJSON.CreateFromTables.
Now, outputParam fields are not mandatory, but if there are any I'd like to parse and put them as name-value pairs in a TRawUTF8List.

What is the best/fastest way to achieve that?
Thank you

Offline

#2 2015-05-06 00:30:24

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Parsing JSON fields in a TRawUTF8List

You should have all the parameters in the TDocVariantData instance.

Offline

Board footer

Powered by FluxBB