Skip to content

Client provided id handling changes #276

@binarypaladin

Description

@binarypaladin

Is your feature request related to a problem? Please describe.

Allow id field to be set outside the attributes object.

In the main API I operate, idempotence on create is handled by just setting the id of the resource. It's one of the joys of using UUIDs. Ash currently works with this:

{
  "data": {
    "attributes": {
      "id": "d67fc7b1-24d1-4c3a-9129-97ece194cbc8"
    }
  }
}

But not this:

{
  "data": {
    "id": "d67fc7b1-24d1-4c3a-9129-97ece194cbc8"
}

Describe the solution you'd like

Simply accept id as a direct child of data. (I would say if the client provided it in two spots, an error is returned rather than argue about which has precedence.)

Express the feature either with a change to resource syntax, or with a change to the resource interface

Accepting IDs shouldn't require any actual DSL unless you wanted to support returning errors on id being a direct child of data.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions