Use faker.Js to generate responses #29
Unanswered
StanleyMasinde
asked this question in
Ideas
Replies: 2 comments 10 replies
-
@StanleyMasinde i think this is a good idea but quick question, how do we ensure the consistency of data? doesn't generating the data using faker change every time one requests for it? |
Beta Was this translation helpful? Give feedback.
7 replies
-
If a user makes a request to get a list of users, the API should return a
list of user objects containing the expected information, such as the
user's id and name. If the user then makes a request for a specific user
with a certain id, the API should return the corresponding user object with
the same id and name as in the previous list.
My take, It would be appropriate to hard-code the values for the user ids
and names in the API, rather than using a library like faker.js to generate
randomized values. This will ensure that the same user object is returned
for a given id, and that id and name match across different requests.
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What do you guys think of using faker.js to generate responses as opposed to hard coded values.
We need to ensures consistency e.g
CC @opensource254/backend @miami78 @cyrus43
Beta Was this translation helpful? Give feedback.
All reactions