Core: Update uses prefixed id instead of originId

Created on 27 Mar 2019  路  3Comments  路  Source: api-platform/core

When initiating update from admin component, PUT request looks like:
{
@context: "/api/contexts/Company"
@id: "/api/companies/49481a25-d948-401b-9fee-12f4d07f0ed3"
@type: "Company"
created_at: "2019-03-25T14:14:49+03:00"
enabled: true
id: "/api/companies/49481a25-d948-401b-9fee-12f4d07f0ed3"
name: "Company name"
originId: "49481a25-d948-401b-9fee-12f4d07f0ed3"
}

And getting error back pointing that server is trying to set id="/api/companies/49481a25-d948-401b-9fee-12f4d07f0ed3"

question

Most helpful comment

Your id should be read only so that this doesn't happen.

All 3 comments

Your id should be read only so that this doesn't happen.

Thank you. Already got it.

But I'm curious why the id property is serialized like that? It looks wrong to me?

Was this page helpful?
0 / 5 - 0 ratings