Questions tagged [jsog]

JSOG (Java Script Object Graph), a convention which allows arbitrary object graphs to be represented in JSON. It allows a large, complicated, cyclic object graph to be serialized and deserialized to and from JSON.

JSOG - JavaScript Object Graph

JSOG (JavaScript Object Graph) is a simple convention which allows arbitrary object graphs to be represented in JSON. It allows a large, complicated, cyclic object graph to be serialized and deserialized to and from JSON.

The problem with JSON

JSON is widely used as a data interchange format, however, it is limited:

  • Only directed acyclic graphs can be represented.
  • Graphs with repeating information are duplicated on the wire and in memory.

Resources

14 questions
6
votes
0 answers

Swagger-codegen generated model deserialization issues - Unrecognized field "@id"

I am trying to use swagger-codegen generated code to consume my REST service, which is defined in my swagger.json (which is provided on server side by springfox 2.9.0) I am generating api, models, and supporting files. But every time I try to…
kscherrer
  • 5,486
  • 2
  • 19
  • 59
6
votes
3 answers

Parsing framework that deals well with circular references in JSON

I am working on an Android project and am currently trying to figure out how to deserialize some JSON from our APIs that includes reference cycles into an object graph, which I can then manipulate and store in a database. Let me give an example: { …
Rafał Sroka
  • 39,540
  • 23
  • 113
  • 143
4
votes
2 answers

angular httpclient custom json parser (jsog)

I'm just discovering the new Angular 4.3.x HttpClient Module, and I may very well be overlooking something simple. I would like to know if it is possible to register a custom JSON Deserializer and still get the benefit of the typed HttpClient…
f-aubert
  • 125
  • 2
  • 9
4
votes
1 answer

@JsonIdentityInfo custom reference serialization?

With @JsonIdentityInfo we can do things like : { "@id" : 1, "value" : 13, "next" : { "@id" : 2, "value" : 42, "next" : 1 } } The reference is a primitive type. It it possible to have the reference be…
redben
  • 5,578
  • 5
  • 47
  • 63
3
votes
2 answers

angular equals method fails because of "too much recursion"

I have a javascript object graph that contains cyclical references. When I use this object in angular, firefox gives me the following error message (the "..." contains 100+ duplicates of the same line preceding and following it): Error: too much…
andersonbd1
  • 5,266
  • 14
  • 44
  • 62
2
votes
1 answer

RestKit mapping for JSOG API object

I'm trying to figure out how to realize a mapping of an API response into CoreData objects using RestKit. The API uses JSOG standard. Here is an example: [ { "@id": "1", "name": "Sally", "friend": { "@id":…
Rafał Sroka
  • 39,540
  • 23
  • 113
  • 143
1
vote
3 answers

Serializing an object in typescript with methods and a cyclical reference graph

I have a fairly substantial project in typescript that uses a lot of object-oriented programming, resulting in a nontrivial object graph (including some objects indirectly pointing to themselves). I now need to serialize this graph to a string. Is…
RWeb
  • 45
  • 7
1
vote
0 answers

@JsonIdentityInfo doesn't handle circular references correctly in a generic list

I'm serializing and deserializing a list including two objects, with circular references there. First I tried ObjectIdGenerators.StringIdGenerator as the generator. //Using latest version for the dependencies //jackson.version =…
Anderson
  • 2,496
  • 1
  • 27
  • 41
0
votes
1 answer

how do i generate an object not just a ref in spring boot/react via jsog?

I'm new to jsog but I know it can help with generating array objects from back end to front end. instead of an object after first element if array i get a reference like this, 0: {@id: '1', id: 1, value: 'calgary', region: {…}, neighborhoods:…
0
votes
0 answers

Resolve reference json in js

how can I solve the json reference and get the object in js? { laboratorio: { @id: "5", version: 17, idLaboratorio: 25779, codLaboratorio: 30 } laboratorioPedido: {@ref: "5"} } I want something like…
user6621606
0
votes
0 answers

Parsing JSOG in Swift to dictionary

I need to parse JSOG in my iOS application on swift. I'm trying to write deserializer by myself, but I don't know how to work with so abstract values. I have something like this, but it didn't work. func parseElemJsog(refs: inout [String: Any],…
TiiRiiX
  • 133
  • 1
  • 9
0
votes
1 answer

jsog-jackson: Serializing object graphs

I am trying to serialize an object graph with parent/child references, essentially I have an entity that looks like this: @Entity (name = "Container") @JsonIdentityInfo(generator=JSOGGenerator.class) public class Container { public String type =…
lanoxx
  • 12,249
  • 13
  • 87
  • 142
0
votes
1 answer

Assign Jackson-Jsog's @id to a member variable

Is it possible to assign the jsog's @id value to an member variable in a POJO class? For example I have a json: "user": { "@id": "1", "name": "John Doe" } And Java class @JsonIdentityInfo(generator=JSOGGenerator.class) public class User { …
thehayro
  • 1,516
  • 2
  • 16
  • 28
0
votes
2 answers

How add the reference to JSOG.js (nativescript and angular2)?

I am trying manipulate JSON objects in a android project using NativeScript and Angular2, but, I can't add the reference to JSOG.js. First, I run the command npm install jsog --savein prompt (Windows). Then, I put reference in file. I tried put the…
Fernanda
  • 13
  • 4