Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are the resource properties always the same? #6

Closed
igorsantos07 opened this issue Apr 24, 2014 · 5 comments
Closed

Are the resource properties always the same? #6

igorsantos07 opened this issue Apr 24, 2014 · 5 comments

Comments

@igorsantos07
Copy link

I'm using the service to run unit tests into a generic REST client, but I've noticed the values have changed after some time with no specific reason.

Are the post title/bodies regenerated every once in a while?
If that's true I'll have to stop comparing arrays and start matching fields against regexps to make sure I'm getting everything I should get...

@typicode
Copy link
Owner

typicode commented May 6, 2014

Sorry for taking so long to answer.

JSONPlaceholder is running on a free Heroku plan. So when there's no requests for some time, it goes to sleep. Then when another request comes, application is started and database is regenerated.

I see that it can be annoying and will try to fix it.

Actually, the only thing that doesn't change is the id and the number of elements.

@igorsantos07
Copy link
Author

Wow! Got it.

Maybe you could disable the data randomizer? This way everytime the db is regenerated it will have the same dataset.

@typicode
Copy link
Owner

I'm generating now a static data.json file (it's already in the repo). So it's generated once and for all.
I need to fix a few things, but I hope to release the fix for this issue this week.

@typicode
Copy link
Owner

Pushed to Heroku. Now resources shouldn't change :)

@igorsantos07
Copy link
Author

Awesome! Should I add again how great was this idea? (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants