Skip to content
Development
Skill

/api-platform-serialization

Control API Platform serialization with groups, #[Context], IRI links (readableLink/writableLink), and custom context builders

From plugin
superpowers-symfony
22744 skills14 agents13 commands1 hook

Claude Code

$ npx -y skills add dev-toolings/superpowers-symfony --skill api-platform-serialization --agent claude-code

SKILL.md

api-platform-serialization.SKILL.md
name: api-platform-serialization
description: "Control API Platform serialization with groups, #[Context], IRI links (readableLink/writableLink), and custom context builders"
capabilities: [read, search, edit, shell]
tags: [api-platform]
# projected by `bun run build` — do not edit by hand
allowed-tools:
  - Read
  - Glob
  - Grep
  - Write
  - Edit
  - Bash

Api Platform Serialization (Symfony)

Use when

  • Operations must expose different fields (list, read, create, update).
  • A related resource must render as an IRI or be embedded.
  • A response needs computed or role-dependent fields.
  • A property needs normalizer options such as a date format.

Default workflow

1. Name groups `entity:operation` and set `normalizationContext` and `denormalizationContext` per operation. 2. Tag properties with `#[Groups]` from the Serializer `Attribute` namespace, not the old `Annotation` one. 3. Control relations with `#[ApiProperty(readableLink: false, writableLink: false)]` to force IRIs. 4. Apply per-property options with `#[Context]` instead of writing a normalizer. 5. Add computed fields in a custom normalizer, and dynamic groups in a decorator of `api_platform.serializer.context_builder`. 6. Prevent cycles with `#[MaxDepth]` and `enable_max_depth`, and hide secrets with `#[Ignore]`.

Guardrails

  • Use separate read and write groups: for example `password` only in the create group, `id` only in read groups.
  • A related resource is embedded only when it shares a group with the parent; otherwise it renders as an IRI.
  • `#[MaxDepth]` has no effect unless `enable_max_depth` is true in the context.
  • Keep entities clean: computed fields belong in normalizers.

Progressive disclosure

  • Use this file for execution posture and risk controls.
  • Open references when deep implementation details are needed.

Output contract

  • The groups and contexts per operation, as a field matrix.
  • Normalizers or context builders added, and how they are registered.
  • Tests or OpenAPI output showing the resulting fields.

References

  • `reference.md`
Read more
@dev-toolings
Ships withsuperpowers-symfony

Superpowers Symfony gives coding agents deep, version-accurate Symfony expertise: from Doctrine schema design and API Platform REST/GraphQL APIs to test-driven development, async Messenger workflows, caching, rate limiting, and clean architecture.

22744 skills14 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
227
Star history of dev-toolings/superpowers-symfony on GitHub, a chart by star-history.com

Other skills on superpowers-symfony.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about api-platform-serialization.

Which coding agents can use api-platform-serialization?
api-platform-serialization installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.