iamshaunjp / iamshaunjp/Complete-React-Tutorial

Lesson 16 - JSON Server - id field must be String in db.json

Open
#36 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
2k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

I have encountered a syntax change related to the id field in the json-server package when upgrading to version 1.0.0-alpha.20. The id field of an data object was previously an integer, and in the updated version, it is expected to be a string.

Consider this example form "https://www.npmjs.com/package/json-server":

{
"posts": [
{ "id": "1", "title": "a title" },
{ "id": "2", "title": "another title" }
],
"comments": [
{ "id": "1", "text": "a comment about post 1", "postId": "1" },
{ "id": "2", "text": "another comment about post 1", "postId": "1" }
],
"profile": {
"name": "typicode"
}
}

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.