There was an error while loading. Please reload this page.
The purpose of this article is to correlate querystring parameter usage in jsonapi-resources with the jsonapi specification
Given the example resource:
class UserResource < JSONAPI::Resource attribute :first_name attribute :last_name attribute :email attribute :created_at attribute :updated_at paginator :offset end
and the following route (in routes.rb):
routes.rb
jsonapi_resources :users
we can do the following:
Ascending By A Property /users?sort={property-name}
/users?sort={property-name}
/users?sort=last-name
Descending By A Property /users?sort=-{property-name}
/users?sort=-{property-name}
-
/users?sort=-last-name
Home