ACM-VIT / dolos

a friendly data mocking service to generate random data in the required format, all written in basic javascript; exactly how beginners like.
19 stars 22 forks source link

Write schema processor #41

Closed YashKumarVerma closed 4 years ago

YashKumarVerma commented 4 years ago

Write a function which accepts the schema (JSON body) sent by the user and determines which type of data to fill

Brainshaker95 commented 4 years ago

I would like to work on this issue. Could you please elaborate a bit more?

YashKumarVerma commented 4 years ago

the user would send a json object, in the format of

{
    "name":"string",
    "age":"number",
    "gender": ["male", "female", "other"]
    ....
}

the function should parse this object and determine which type of data is to be inserted

@Brainshaker95

Brainshaker95 commented 4 years ago

So you just want the function to return an object like this?

{
    name: "string",
    age: "number",
    gender: "object",
}

Or what exactly do you mean when you say "type"? Sorry if this is obvious, but I'm not sure what you mean.