Skip to content

Releases: cerebris/jsonapi-resources

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

19 Jan 18:00
Compare
Choose a tag to compare

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

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

19 Jan 17:59
Compare
Choose a tag to compare

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

v0.8.2 - Adds immutable support to routes

19 Jan 14:44
Compare
Choose a tag to compare

Immutable resources will no longer generate routes which modify the resource.

v0.9.0.beta2 - Exception configuration and Bug Fixes

14 Feb 15:29
Compare
Choose a tag to compare

Features

  • Make exception backtraces configurable (instead of defaulting to !production).
  • Adds configuration option to whitelist all exceptions.
  • Loosens Accept header check to allow starts with :api_json
  • Add facility to override error object members in JR Exceptions

Bug Fixes

  • Fix polymorphic type setter
  • Fix issue where resources received context nested in hash
  • Skip preloading of polymorphic relations, better handling of serialization with partially preloaded relations
  • Fix so includes now follow namespacing
  • Rescues JSON parsing error and return all exceptions from the parser in _parser_exception
  • Fixes sort with has one include
  • Fixes an issue where the recreated relationships might be using the wrong model_name if the model_name is changed in a resource that is derived from a non abstract resource, such as done in many of the tests.
  • Fixes issues related to CSV parsing of includes
  • Fixes issues with has_one polymorphic serialization
  • Fixes LoadError issue with engines

Breaking Changes

  • Derived resources now use the model name of their base resource, if it is not abstract.

v0.9.0.beta1 - Resource Caching and Bug Fixes

14 Feb 15:22
Compare
Choose a tag to compare

Features

  • Caching support for ActiveRecord based resources
  • Ids are now fetched through resource method which delegates to model
  • Now handles all base spec requests as a single operation

Bug Fixes

  • Fixed missing context on show_related_resources
  • Fixes handling of valid media types
  • Fixes issue with controller filter order conflicts when checking media types
  • Fixes situation where the linkage data could be partially calculated
  • Fixes mismatch of object_id in exception_class_whitelist
  • Fixes issue with rails engines paths and resources without namespaces
  • Fixes issue rebuilding self link when link is provided
  • Fixes handling camelized resources when looking up resource classes
  • Fixes bug where immutable resources were generating routes for methods which mutate the resource
  • Fixes issue with missing relationship data when serializing with complex includes

Breaking Changes

  • Removed deprecated updateable and createable methods (note misspellings). Use updatable and creatable instead.
  • Drops support for rails 4.1
  • Sets the required_ruby_version to 2.1

v0.8.1 - Bug fixes

05 Oct 15:40
Compare
Choose a tag to compare

Bug Fixes:

  • Fixes the situation where the current user does not have permission to access a relationship, and the library was returning a partially complete data object for that relationship when it was polymorphic (the id would be provided, but the type would be an empty string because of the way that Relationship.type_for_source works). To keep it all simple and avoid any side effects, I'm just not returning a partial data object (where either the id or the type are nil) now.
  • Fixes issue with generating paths with rails engines when not using additional namespaces.
  • Removes ActiveRecord dependency
  • No longer calls link_builder when custom link is provided
  • Fix handling camelized argument in JSONAPI::Resource.resource_for

v0.8.0 - Rails 5, Processors, performance improvements, bug fixes and more

15 Sep 21:07
Compare
Choose a tag to compare

This is a large release and includes the 0.7.1.beta1 and 0.7.1.beta2 features. Note that there was not a 0.7.1 release. There were several breaking changes introduced so the project was moved to 0.8.0.

Breaking changes are called out below

Features:

  • Rails 5 support
  • Breaking change: Operation Processing - OperationsProcessor replaced with Resource specific processors
  • Breaking change: Support for Ruby 2.0 was removed
  • Documentation expanded
  • always_include_linkage_data for relationships
  • i18n to easily customize errors messages
  • Adds jsonapi:controllers generator
  • Validation errors can have metadata added to them
  • Custom links defined per resource
  • Allow Hash values for filter params
  • Whitelisted exceptions now work with a base class
  • Support for sorting on relationship fields
  • Attribute Delegation
  • Ability to specify validation context
  • Add page_count to metadata
  • Ensures media type of Accept header is valid according to the JSON API spec
  • Caching of formatters for performance
  • ResourceControllerMetal
  • Add count_records method
  • belongs_to method now supported as a deprecated alias for has_one. Helpful for new users transitioning to the project
  • Adds allow_transactions configuration option for use with backends that do not support transactions such as MongoDB
  • Default sorting
  • Relationship Reflection
  • eager_load_on_include relationship option

Bug fixes:

  • Many documentation fixes
  • Error code representation from integers to strings
  • Returns a relation instead of a class from Resource.records
  • Fix issues with filters involving relationships
  • Offset and paged paginators links consistent with JSON API spec e.g. prev instead of previous
  • Accept nil data when updating polymorphic to_one relationship
  • Fix dasherized paths for scoped routes
  • Removes a git dependency in gemspec
  • ids now respect creatable_fields
  • Several polymorphic behavior fixes
  • Add warnings for duplicate attributes and relationship names
  • Adds missing context to get_related_resources
  • Cleans up the accepted media types.
  • Fixes resources missing relationship data when serialized with complex includes.

Fix missing relationship data

15 Sep 21:10
Compare
Choose a tag to compare
Pre-release

Fixes an issue where relationship data could be lost when a request specified an include statement that nested resource types at different levels; for example posts.author.posts.

v0.8.0.beta2 - Minor fixes

10 Aug 21:20
Compare
Choose a tag to compare
Pre-release
  • Adds missing context to get_related_resources
  • Cleans up the accepted media types.
  • Readme cleanup

v0.8.0.beta1 - Rails 5, Processors, performance, bug fixes and more

22 Jul 15:50
Compare
Choose a tag to compare

This is a large release and includes the 0.7.1.beta1 and 0.7.1.beta2 features. Note that there was not a 0.7.1 release. There were several breaking changes introduced so the project was moved to 0.8.0.

Breaking changes are called out below

Features:

  • Rails 5 support
  • Breaking change: Operation Processing - OperationsProcessor replaced with Resource specific processors
  • Breaking change: Support for Ruby 2.0 was removed
  • Documentation expanded
  • always_include_linkage_data for relationships
  • i18n to easily customize errors messages
  • Adds jsonapi:controllers generator
  • Validation errors can have metadata added to them
  • Custom links defined per resource
  • Allow Hash values for filter params
  • Whitelisted exceptions now work with a base class
  • Support for sorting on relationship fields
  • Attribute Delegation
  • Ability to specify validation context
  • Add page_count to metadata
  • Ensures media type of Accept header is valid according to the JSON API spec
  • Caching of formatters for performance
  • ResourceControllerMetal
  • Add count_records method
  • belongs_to method now supported as a deprecated alias for has_one. Helpful for new users transitioning to the project
  • Adds allow_transactions configuration option for use with backends that do not support transactions such as MongoDB
  • Default sorting
  • Relationship Reflection
  • eager_load_on_include relationship option

Bug fixes:

  • Many documentation fixes
  • Error code representation from integers to strings
  • Returns a relation instead of a class from Resource.records
  • Fix issues with filters involving relationships
  • Offset and paged paginators links consistent with JSON API spec e.g. prev instead of previous
  • Accept nil data when updating polymorphic to_one relationship
  • Fix dasherized paths for scoped routes
  • Removes a git dependency in gemspec
  • ids now respect creatable_fields
  • Several polymorphic behavior fixes
  • Add warnings for duplicate attributes and relationship names