Skip to content

v0.8.3 - Bug Fix - Creatable ids breaking rails auto id incrementing

Choose a tag to compare

@lgebhardt lgebhardt released this 19 Jan 17:59
· 416 commits to master since this release

Fixed #960: Where having id creatable allows for a request specifying an id to break future requests due to id conflicts. Observed on Postgres, though it could possibly happen with other database systems.

Breaking Change: If you need ids to be created by the client, say for using GUIDs, you must now add the id to the creatable_fields method:

class FooResource < JSONAPI::Resource
  def self.creatable_fields(_context = nil)
    super + [:id]
  end
end