api-platform / core

The server component of API Platform: hypermedia and GraphQL APIs in minutes
https://api-platform.com
MIT License
2.45k stars 874 forks source link

For JSON:API, the ID is not required in the POST request #6738

Open cay89 opened 2 weeks ago

cay89 commented 2 weeks ago

API Platform version(s) affected: 4.0.4

Description
According to the JSON:API documentation, an ID is not required in a POST request, but Api Platform requires it in OpenAPI documentation.

image

Can this be resolved so that the ID is not mandatory in a POST request? It also throws an error when I include an ID.

cay89 commented 2 weeks ago

I wouldn't create a new issue, but I don't think the link in the response header is good either:

image

dunglas commented 2 weeks ago

If you didn't disable JSON-LD, this link is expected for autodiscoverability of the Hydra docs.

cay89 commented 2 weeks ago

If you didn't disable JSON-LD, this link is expected for autodiscoverability of the Hydra docs.

I think I turned it off:

image

dunglas commented 2 weeks ago

Indeed, that's a bug then!