Skip to content

Commit

Permalink
Fix wrong uses of Faker string.numeric
Browse files Browse the repository at this point in the history
  • Loading branch information
255kb committed Nov 29, 2023
1 parent 5f4ee5d commit 17eb605
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions content/tutorials/generate-mock-json-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Let's have a look at what such a body could look like:
"avatar": "{{faker 'image.avatar'}}"
},
"comments": [
{{#repeat (faker 'string.numeric' 5)}}
{{#repeat (faker 'number.int' 5)}}
{
"id": "{{faker 'string.uuid'}}",
"content": "{{faker 'lorem.sentence'}}",
Expand All @@ -66,8 +66,8 @@ Let's have a look at what such a body could look like:
}
{{/repeat}}
],
"likes": {{faker 'string.numeric' 100}},
"shares": {{faker 'string.numeric' 100}},
"likes": {{faker 'number.int' 100}},
"shares": {{faker 'number.int' 100}},
"location": {
"lat": {{faker 'location.latitude'}},
"long": {{faker 'location.longitude'}}
Expand Down Expand Up @@ -152,7 +152,7 @@ Generating an XML file with fake data would also be done in no time. You will fi
<NAME>{{faker 'commerce.product'}}</NAME>
<PRICE>{{faker 'commerce.price'}}</PRICE>
<COLOR>{{faker 'color.human'}}</COLOR>
<INVENTORY>{{faker 'string.numeric' 2}}</INVENTORY>
<INVENTORY>{{faker 'number.int' 50}}</INVENTORY>
</PRODUCT>
{{/ repeat}}
</PRODUCTS>
Expand Down Expand Up @@ -243,7 +243,7 @@ Let's imagine an endpoint `GET /inventory/:type` returning either "products" or
{{/ case}}
{{# case 'materials'}}
"name": "{{faker 'commerce.productMaterial'}}",
"quantity": "{{faker 'string.numeric' 2}}"
"quantity": "{{faker 'number.int' 50}}"
{{/ case}}
{{/ switch}}
}
Expand Down

0 comments on commit 17eb605

Please sign in to comment.