typicode / jsonplaceholder

A simple online fake REST API server
https://jsonplaceholder.typicode.com
MIT License
5.05k stars 582 forks source link

Add dates to the random data #21

Open fzaninotto opened 9 years ago

fzaninotto commented 9 years ago

One crucial data type I'm missing from JSONPlaceholder are dates and datetimes. However, the domain could allow for such data (e.g. publication date for posts and comments, creation date for posts, completion data for todos, etc).

Is the current database frozen forever, or do you think the current data can be made richer?

typicode commented 9 years ago

Hi @fzaninotto,

Well, I'd rather keep it frozen since it's already used a lot.

But for dates, what would be more convenient: recent dates that are changed every months or fixed ones that will get old eventually?

fzaninotto commented 9 years ago

In fact, I'd need many types.

I have begun to build a new dataset, much richer than the one from jsonplaceholder. Not only does it have more datatypes, it also has plausible data, which can be used to demonstrate a powerful API client (you may guess why I'm writing that). It comes with a Node generator that updates (and extends) it at will.

Would you like if I contributed this dataset to build a second server? I wouldn't mind open sourcing it.

fzaninotto commented 9 years ago

So here is the dataset I was mentioning: https://github.com/marmelab/ng-admin-demo/blob/gh-pages/data.js

It's used as s source for http://marmelab.com/ng-admin-demo/, using not jsonplaceholder but FakeRest. I'd love a JSONPlaceholder with that kind of data, though...

brgrz commented 5 years ago

The data being offered at the moment is really basic. Dates are absolute must, time would be nice too and numerical data, for instance, decimal/money would be nice, also integers, for example, quantity.

brgrz commented 5 years ago

Well, I'd rather keep it frozen since it's already used a lot.

Adding additional properties to the serialized JSON does not break existing clients in no way.

brgrz commented 5 years ago

Lol only now I saw this has been open since 2015. Seriously, how hard can this be?

brgrz commented 5 years ago

@fzaninotto Please explain what do you need/require to add that additional types of data, willing to help.

fzaninotto commented 5 years ago

We've released a more complete test data set under the data-generator-retail npm package. It's got dates... and much more. https://www.npmjs.com/package/data-generator-retail