Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

280
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!