bookshelf-api icon indicating copy to clipboard operation
bookshelf-api copied to clipboard

Problem using UUIDs

Open Banbury opened this issue 8 years ago • 2 comments

I'm using UUIDs as IDs in my models. When I make a GET request with an id (e.g. user/:id) and the UUID starts with a number, the related objects (oneToMany) aren't loaded. It works when the UUID starts with a letter.

I'm guessing, that somewhere the ID is converted to a number.

Banbury avatar Nov 13 '16 11:11 Banbury

@Banbury thanks for the bug report. I'll take a look at this and let report back when I have a fix.

alarner avatar Nov 22 '16 02:11 alarner

@Banbury just did a little bit of digging and I can't seem to reproduce the error that you're talking about. I've added two unit tests here that I think mimic the problem you're describing. If you're still running into this issue could you share...

  1. your database schema
  2. some example data
  3. the get request that is failing
  4. any errors that you see

Thanks!

alarner avatar Nov 22 '16 03:11 alarner