lib/jsonapionify/structure/objects/resource.rb in jsonapionify-0.9.0 vs lib/jsonapionify/structure/objects/resource.rb in jsonapionify-0.9.1
- old
+ new
@@ -1,8 +1,10 @@
module JSONAPIonify::Structure
module Objects
# ResourceObjects appear in a JSON API document to represent resources.
class Resource < ResourceIdentifier
+ define_order *%i{type id attributes relationships meta links}
+
# The `id` member is not required when the resource object originates at the
# client and represents a new resource to be created on the server.
must_contain! :id, if: ->(obj) { obj.server? } # an id representing the resource
# In addition, a resource object **MAY** contain any of these top-level members: