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

165
Views
Get json data structure with nodejs

This is a problem that is so hard for me to find using just keywords -- I've scrolled pages after pages and all the hits are on getting data from json structure, instead of getting data structure from json.

If you don't know what goal I'm trying to achieve, here are tools to get data structure from json to Go:

  • https://mholt.github.io/json-to-go/
    This tool instantly converts JSON into a Go type definition
  • https://json2struct.mervine.net/
    Convert JSON in to a useful struct.
  • https://transform.tools/json-to-go
    online playground to convert JSON to Go Struct

For one specific application, I'm getting data with all kinds of slightly different json data structures, which makes my data extraction failing all the times. I need to compare those data structure-wise, as each individual json data are surely different.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It looks like you're struggling to find what you want because vanilla JavaScript doesn't have the type concepts you're trying to use.

You probably want to generate a json schema or a typescript interface, and searching "JSON to schema npm" will get you more useful results.

One such example is to-json-schema

import toJsonSchema from 'to-json-schema';

toJsonSchema({ "foo": "bar", "x": [1, 2] });
/* returns
{
  "type": "object",
  "properties": {
    "foo": {
      "type": "string"
    },
    "x": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    }
  }
}
*/

For more specific answers you'd need to provide some minimal sample of input and output, e.g. what would you expect from { "foo": "bar", "x": [1, 2] }

about 4 years ago · Juan Pablo Isaza Report
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!