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

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

Open
stav19 opened this issue Jan 13, 2024 · 0 comments
Open

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

stav19 opened this issue Jan 13, 2024 · 0 comments

Comments

@stav19
Copy link

stav19 commented Jan 13, 2024

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"
                }
              }
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

1 participant