Skip to content

docs(jsonapi): document opt-in client-generated IDs#2287

Merged
soyuka merged 1 commit into
api-platform:4.3from
soyuka:feat/jsonapi-client-generated-id
Jun 6, 2026
Merged

docs(jsonapi): document opt-in client-generated IDs#2287
soyuka merged 1 commit into
api-platform:4.3from
soyuka:feat/jsonapi-client-generated-id

Conversation

@soyuka
Copy link
Copy Markdown
Member

@soyuka soyuka commented Jun 5, 2026

Summary

  • Adds a Client-Generated IDs section to core/jsonapi.md explaining the JSON:API spec allowance (§crud-creating-client-ids) and API Platform's default refusal for security reasons.
  • Documents global enablement via api_platform.jsonapi.allow_client_generated_id: true (Symfony YAML) and the equivalent Laravel config key.
  • Documents per-operation enablement via denormalizationContext: [ItemNormalizer::ALLOW_CLIENT_GENERATED_ID => true] on #[Post], with a complete code example and sample HTTP request.
  • Notes that the response (output) schema still requires id; only the POST input schema marks it as optional.

Tracks: api-platform/core#7930 and api-platform/core#6738.

Test plan

  • Verify rendered page under Core → JSON:API shows the new section after "Resources Without a Standalone Item Endpoint".
  • Confirm code examples are syntactically valid PHP 8.x and the YAML indentation is 4 spaces.
  • Run markdownlint locally to confirm no lint errors.

@soyuka soyuka force-pushed the feat/jsonapi-client-generated-id branch from 08da8e2 to 7e8445c Compare June 6, 2026 06:23
@soyuka soyuka changed the base branch from main to 4.3 June 6, 2026 06:23
Add a "Client-Generated IDs" section to core/jsonapi.md covering the
JSON:API spec allowance, the default 400 response, and how to opt in
globally (Symfony YAML / Laravel config) or per-operation via
denormalizationContext. References api-platform/core#7930 and spec
§crud-creating-client-ids.
@soyuka soyuka force-pushed the feat/jsonapi-client-generated-id branch from 7e8445c to b43aa05 Compare June 6, 2026 06:24
@soyuka soyuka merged commit 16ea455 into api-platform:4.3 Jun 6, 2026
3 checks passed
@soyuka soyuka deleted the feat/jsonapi-client-generated-id branch June 6, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant