Primary Key: uuid
peco8 opened this issue · 2 comments
peco8 commented
I've been using json-api resource and want to move on to this library.
However I just wonder if I could use uuid
instead of id
for resource sometimes.
In json-api resource, we can do something like:
class ContactResource < JSONAPI::Resource
attribute :id
attributes :name_first, :name_last, :email, :twitter
key_type :uuid
end
I wonder if I could do the same thing in jsonapi-utils.
TrevorHinesley commented
As far as I can tell, this still uses JR's resources library, so that should be fine.
tiagopog commented
Yeah, @peco8, it should work normally. As @TrevorHinesley pointed, JU is just a layer over JR that provides a set of useful helpers (e.g. its renders and formatters) in order to ease the way JSON APIs are built on Rails.
Sorry for the delay in replying, I had a really busy day today. Anyway, feel free to come with other questions, I'll try to answer as soon as I can.