Questions tagged [superobject]

The SuperObject JSON library created by Henri Gourvest for Delphi and FreePascal(Lazarus, CodeTyphon, etc)

After Henri Gourvest quitted his involvement in Delphi and shut down his original site, his projects were moved to OpenSource source hosts, mostly onto Google Code.

The very name and design (and usage patterns) may be were influenced by this concept http://communitywiki.org/en/SuperObject

57 questions
3
votes
1 answer

Modify SuperObject to format/indent JSON string differently?

While using the SuperObject library, a single JSON object currently gets indented like so: { "name": "value", "int_arr": [ 1,2,3], "obj_arr": [ { "this": "that" },{ "some": "thing" }], "another": 123 } However, this…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
3
votes
1 answer

Access JSON array using SuperObject

I have recently switched from using ULKJson to SuperObject and I have been looking around at the examples that come with the package and have made some headway with most it it, but it appears as I have come across a snag. To be more specific, I…
avue
  • 129
  • 1
  • 6
  • 15
3
votes
1 answer

Delphi SuperObject sorting values in a different order than added

I'm using SuperObject to produce JSON. The server I'm working with has some specifications for sorting data results (the fact that this is related to sorting data has nothing to do with my actual question about sorting). The thing is, the server…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
3
votes
1 answer

SuperObject cannot handle null string

Some JSON serializers return null for an empty string datafield, e.g. { "searchtext": null, "moretext": "contains something", "bookdate": 1377468000000, "empid": 12345, "listtype": 1 } I'm using SuperObject to create a ISuperObject: var …
Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
3
votes
0 answers

Serializing SuperObject JSON for variant length arrays gives FastMM "modified after freed" error

Serializing SuperObject JSON for variant length arrays gives FastMM "modified after freed" error I'm wondering why the next code for testing (de)serialization of variant length arrays: type TSimpleVarArray = Array of Integer; procedure…
Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
3
votes
1 answer

Cannot de-serialize SuperObject JSON into Object

Types: TData = record str: string; int: Integer; boo: Boolean; flt: Double; end; TDataArray = Array [0..5] of TData; TObj = class private str: string; int: Integer; boo: Boolean; flt: Double; public constructor Create(s: string;…
Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
3
votes
0 answers

Deserialization JSON to objects with interface fields using SuperObject

I'm having trouble deserializing an object containing a interface field from json using SuperObject (serialization works fine) on DXE2. Consider the following: ITest = interface(IInterface) ['{9E5623FF-1BC9-4FFA-919D-80C45EE24F38}'] …
conciliator
  • 6,078
  • 6
  • 41
  • 66
3
votes
1 answer

Delphi: superobject serialization custom converter/inverter

I'd like to serialize objects and records to send them and restore on a remote endpoint. There is the shared objects declaration unit for a local and remote end. I has a record with a field containing different records as JSON Object: TPmMessage =…
r3code
  • 51
  • 1
  • 6
3
votes
2 answers

SuperObject Serializes Private Variables instead of Properties

I have the following code that serializes a dynamic array of classes. For some reason SuperObject serializes on the private variables instead of the class property names. Can anyone please advise how to fix this behaviour in SuperObject? class…
Phillip Roux
  • 1,009
  • 7
  • 12
2
votes
2 answers

communication with rpc service using indy HTTP client and Superobject DELPHI http 400 error code

Ok im stumped the following code gives me a http 400 error which tells me there is something wrong with the submitted data but i cant figure out what!:( the client is set to encode URL (Ive tried both true/false); procedure…
Strspeed
  • 21
  • 1
  • 2
2
votes
1 answer

JSON with SuperObject: is element an array or an object?

I get JSON from API and it have a quirk: usually it returns "tags" element as object {"x":"y"}, but if ther are no tags, it returns empty array [] instead. I parse JSON with SuperObject, and use this code: var JsonObject: ISuperObject; item:…
Alexander
  • 388
  • 1
  • 12
2
votes
2 answers

Delphi SuperObject - is there a (recursive) search function that tells where a value can be found?

I'm using SuperObject to create and manipulate a simple hierarchical structure in JSON. My goal is to transform a set of objects {"id":..., "name":..., "parent":...} into a hierarchical structure. Example: I want to transform this {"id":…
2
votes
1 answer

Super Object - spaces in element names

I'm using Super Object as a JSON parser. I ran into a problem while working with a third-party API. The API returns JSON with spaces in the element names. However, Super Object does not work with spaces. I observed behavior where it treats the space…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
2
votes
1 answer

Problems getting the JSON data from DLL using SuperObject and OmniThreadLibrary

I'm using Delphi XE, I have the following code for my program and DLL: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, superobject, OtlCommon, OtlCollections,…
LuFang
  • 191
  • 3
  • 12
2
votes
2 answers

Extracting values from JSON file using SuperObject

As the title suggest I am trying to extract a value from a very simply structured JSON file using Delphi 7 and the SuperObject Library, but I have yet to find any examples that cover this most basic topic and was hoping some of the gurus here might…
user3803565
  • 23
  • 1
  • 3