Closed beauby closed 7 years ago
When a payload is deserialized, a set of json pointers for the deserialized fields is generated, which can then be used when serializing errors.
# Incoming payload { data: { id: "1", type: "users", attributes: { name: "Lucas", email: "lucas@jsonapi-rb.org" }, relationships: { posts: { data: [{ type: "posts", id: "2" }, { type: "posts", id: "3" }] } } } } # Deserialized params (via `deserializable_resource :user`) { id: "1", type: "users", name: "Lucas", email: "lucas@jsonapi-rb.org", post_ids: ["2", "3"], post_types: ["posts", "posts"] } # Reverse mapping / json pointers { id: "/data/id", type: "/data/type", name: "/data/attributes/name", email: "/data/attributes/email", post_ids: "/data/relationships/posts/data", post_types: "/data/relationships/posts/data" }
ActionController
jsonapi_pointers
Closed by #29.
When a payload is deserialized, a set of json pointers for the deserialized fields is generated, which can then be used when serializing errors.
Example
Possible interface
ActionController
instance method, possibly namedjsonapi_pointers