Skip to content

Thread-safe custom headers for Rails users

Pre-release
Pre-release
Compare
Choose a tag to compare
@jsmestad jsmestad released this 05 Jun 17:20
· 7 commits to master since this release

The changes are not expected to impact users of v1.x, but since it's technically changing the API v2.x is appropriate.

Enhancements

  • Allow message to be passed in when raising any JSONAPI::Consumer::Error class.
    • This is handy when a client wants to re-raise an error with additional information.
  • Remove all Object#send in favor of the "more secure" Object#public_send

Bugfixes

  • Custom Headers will now work correctly with threaded servers such as Puma or Unicorn thanks to the added request_store dependency.
  • A custom_method will now obey Resource#route_formatter setting when generating custom endpoint paths.
    • For example: custom_endpoint :publish_now, on: :member, request_method: :post will now generate http://example.com/countries/1/publish-now when route_formatter is set to :dasherized_route