We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Steps- 1.Create a JSON file (Ninja.json) with the following content { "Ninjas": [ { "UID": 1, "name": "Neji", "courses": ["Maths", "Science"], "ContactNum": 1111, "Location": "Mumbai" }, { "UID": 2, "name": "RockLee", "courses": ["Magic", "Science"], "ContactNum": 2222, "Location": "Goa" }, { "UID": 3, "name": "Garaa", "courses": ["Geo", "Science"], "ContactNum": 2222, "Location": "Goa" } ] }
2.Start json-server with json-server Ninja.json
3.Perform a GET request to http://localhost:3000/Ninjas
Expected Behavior { "Ninjas": [ { "id": 1, "name": "Neji", "courses": ["Maths", "Science"], "ContactNum": 1111, "Location": "Mumbai" }, { "id": 2, "name": "RockLee", "courses": ["Magic", "Science"], "ContactNum": 2222, "Location": "Goa" }, { "id": 3, "name": "Garaa", "courses": ["Geo", "Science"], "ContactNum": 2222, "Location": "Goa" }, { "id": 4, "name": "Naruto", "courses": ["Hindi", "Maths"], "ContactNum": 2222, "Location": "Goa" }, { "id": 5, "name": "Sasuke", "courses": ["History", "Economics"], "ContactNum": 2222, "Location": "Goa" } ] }
Actual Behavior [ { "id": "1", "name": "Neji", "courses": [ "Maths", "Science" ], "ContactNum": 1111, "Location": "Mumbai" }, { "id": "2", "name": "RockLee", "courses": [ "Magic", "Science" ], "ContactNum": 2222, "Location": "Goa" }, { "id": "3", "name": "Garaa", "courses": [ "Geo", "Science" ], "ContactNum": 2222, "Location": "Goa" }, { "id": "4", "name": "Naruto", "courses": [ "Hindi", "Maths" ], "ContactNum": 2222, "Location": "Goa" }, { "id": "5", "name": "Sasuke", "courses": [ "History", "Economics" ], "ContactNum": 2222, "Location": "Goa" } ]
Workaround: Changing id to a different field name (e.g., uid) prevents this behavior
Additional Details- C:\Windows\System32>npm --version 10.9.2
C:\Windows\System32>node --version v22.14.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Steps-
1.Create a JSON file (Ninja.json) with the following content
{
"Ninjas": [
{
"UID": 1,
"name": "Neji",
"courses": ["Maths", "Science"],
"ContactNum": 1111,
"Location": "Mumbai"
},
{
"UID": 2,
"name": "RockLee",
"courses": ["Magic", "Science"],
"ContactNum": 2222,
"Location": "Goa"
},
{
"UID": 3,
"name": "Garaa",
"courses": ["Geo", "Science"],
"ContactNum": 2222,
"Location": "Goa"
}
]
}
2.Start json-server with
json-server Ninja.json
3.Perform a GET request to http://localhost:3000/Ninjas
Expected Behavior
{
"Ninjas": [
{
"id": 1,
"name": "Neji",
"courses": ["Maths", "Science"],
"ContactNum": 1111,
"Location": "Mumbai"
},
{
"id": 2,
"name": "RockLee",
"courses": ["Magic", "Science"],
"ContactNum": 2222,
"Location": "Goa"
},
{
"id": 3,
"name": "Garaa",
"courses": ["Geo", "Science"],
"ContactNum": 2222,
"Location": "Goa"
},
{
"id": 4,
"name": "Naruto",
"courses": ["Hindi", "Maths"],
"ContactNum": 2222,
"Location": "Goa"
},
{
"id": 5,
"name": "Sasuke",
"courses": ["History", "Economics"],
"ContactNum": 2222,
"Location": "Goa"
}
]
}
Actual Behavior
[
{
"id": "1",
"name": "Neji",
"courses": [
"Maths",
"Science"
],
"ContactNum": 1111,
"Location": "Mumbai"
},
{
"id": "2",
"name": "RockLee",
"courses": [
"Magic",
"Science"
],
"ContactNum": 2222,
"Location": "Goa"
},
{
"id": "3",
"name": "Garaa",
"courses": [
"Geo",
"Science"
],
"ContactNum": 2222,
"Location": "Goa"
},
{
"id": "4",
"name": "Naruto",
"courses": [
"Hindi",
"Maths"
],
"ContactNum": 2222,
"Location": "Goa"
},
{
"id": "5",
"name": "Sasuke",
"courses": [
"History",
"Economics"
],
"ContactNum": 2222,
"Location": "Goa"
}
]
Workaround:
Changing id to a different field name (e.g., uid) prevents this behavior
Additional Details-
C:\Windows\System32>npm --version
10.9.2
C:\Windows\System32>node --version
v22.14.0
The text was updated successfully, but these errors were encountered: