PUT endpoint does not return correct id (maybe rowid?)

Open
#37 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, sqlite
Domain
databases

Research direction

Reproduce the LoopBack 3 case by creating a model with a string id and uuid defaultFN, then PUT a new instance through the REST API Explorer. Compare the PUT response with the id returned when listing instances through GET; done means the PUT response returns the generated UUID rather than an integer.

Written by the indexing model from the issue text.

Description

Bug or feature request
  • [X ] Bug
  • Feature request
Description of feature (or steps to reproduce if bug)

Create a model with an id as type "string", and a defaultFN of "uuid". PUT a new instance using the REST api through explorer. The response body will show an integer id (presumably an integer that corresponds to the ROWID or something like that). Now use the GET api to list all model instances. The instance will show an id in the correct uuid format.

Link to sample repo to reproduce issue (if bug)
Expected result

I'm assuming the response body should reflect the id generated by defaultFN.

Actual result (if bug)

Its an integer.

Additional information (Node.js version, LoopBack version, etc)

Loopback 3, node 8.11.2

I'm anticipating a reply of "why are you using a string for a key?" The answer is complicated based in integration with a larger project. If the answer is "we don't support that" we'll make it work, but I wanted to check to make sure. Thanks

Dominant language
JavaScript
Stars
13
Forks
21
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from loopbackio/loopback-connector-sqlite3

All issues in loopbackio/loopback-connector-sqlite3

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.