Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

290
Visualizações
How to create a JSON schema by reducing object and removing unnecessary fields?

I am facing issue in converting a Javascript array of objects into JSON. During conversion in JSON, I want to only have concerned values.

The Object which needs to be converted

[
{
    "id": "29705f44114",
    "name": "Object",
    "defaultValue": false,
    "title": "Object",
    "child": [
        {
            "id": "9705f44114e",
            "name": "List",
            "defaultValue": false,
            "title": "List",
            "child": [
                {
                    "id": "5f44114e0ee",
                    "name": "String",
                    "defaultValue": false,
                    "title": "Object"
                },
                {
                    "id": "4114e0eeb30",
                    "name": "Number",
                    "defaultValue": 0,
                    "title": "Number"
                }
            ]
        },
        {
            "id": "705f44114e0",
            "name": "Object",
            "defaultValue": false,
            "title": "Object",
            "child": [
                {
                    "id": "44114e0eeb3",
                    "name": "List",
                    "defaultValue": false,
                    "title": "List"
                }
            ]
        },
        {
            "id": "05f44114e0e",
            "name": "Object",
            "defaultValue": false,
            "title": "Object"
        }
    ]
}

]

I want it to be converted into something like that

Object: {
    List: [
      Object,
      Number
    ],
    Object: {
      List: []
    },
    Object: {}
}

If an Object comes inside another Object then it needs to have a value of {}, if it comes under List then just writing Object is enough

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda