0

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 this:

{
    laboratorio: {
        @id: "5", 
        version: 17, 
        idLaboratorio: 25779, 
        codLaboratorio: 30
    }
    laboratorioPedido: {
        @id: "5", 
        version: 17, 
        idLaboratorio: 25779, 
        codLaboratorio: 30
    } 
}

thanks

SOLVED

It was a JSOG object! (not JSON)

I have used this function and it works

cyclicGraph = JSOG.decode(jsogStructure);
  • 1
    That isn't JSON. JSON doesn't have references, and even without the reference syntax there, it wouldn't be valid JSON. – Quentin Mar 04 '20 at 16:36
  • You're right! It was a jsog object. I was wrong! Thank you very much for the help. I have used this function and it works: `cyclicGraph = JSOG.decode(jsogStructure);` –  Mar 05 '20 at 10:27

0 Answers0