Skip to content
Development
Skill

/api-platform-filters

Implement API Platform filters - Parameters API (QueryParameter, v5/4.4/4.3) and the #[ApiFilter] attribute deprecated since 4.4 - for search, date, range, boolean, and custom filtering

From plugin
superpowers-symfony
22744 skills14 agents13 commands1 hook

Claude Code

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

SKILL.md

api-platform-filters.SKILL.md
name: api-platform-filters
description: "Implement API Platform filters - Parameters API (QueryParameter, v5/4.4/4.3) and the #[ApiFilter] attribute deprecated since 4.4 - for search, date, range, boolean, and custom filtering"
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 Filters (Symfony)

Use when

  • A collection endpoint needs search, exact match, range, date, boolean, or sort query parameters.
  • One query parameter must search across several properties.
  • A filter needs custom query logic that the built-in filters do not cover.
  • Migrating `#[ApiFilter]` declarations (deprecated since 4.4) to the Parameters API, by hand or with `api:upgrade-filter`.

Default workflow

1. Declare `parameters` with `QueryParameter` on the operation; keep `#[ApiFilter]` only in 3.4 code or code not yet migrated. 2. Choose a filter class per parameter, checking the installed version: `ExactFilter`, `PartialSearchFilter`, `FreeTextQueryFilter`, `OrFilter`, `IriFilter` (4.2+), `ComparisonFilter`, `SortFilter` (4.3+), `StartSearchFilter`, `EndSearchFilter`, `ChainFilter` (4.4+). 3. For a custom filter, implement `FilterInterface` and read the bound value from `$context['parameter']` (`AbstractFilter` and `filterProperty()` are deprecated since 4.4: keep them for 4.3 and 3.4 code). 4. Turn on `strictQueryParameterValidation` so unknown query parameters return 400. 5. Add `#[ORM\Index]` on filtered columns, then request the endpoint with matching and non-matching values.

Guardrails

  • Keep filter classes stateless: take request data from `$context`, not the constructor.
  • Expose only the properties clients need to filter on.
  • Use exact matching for ids and foreign keys: partial `LIKE %value%` cannot use an index.
  • In custom filters, validate the value and bind it with `generateParameterName()` and `setParameter()`, never by string concatenation.

Progressive disclosure

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

Output contract

  • The parameters per operation, with filter class and accepted syntax (for example `?price[gte]=1000`).
  • Indexes added for the filtered columns.
  • Tests for a match, an empty result, and an unknown parameter.

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.

skills12d309k
@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,…

ecc2w293k
@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…

react3d252k
@facebook@facebookInstall Skill

Questions about api-platform-filters.

Which coding agents can use api-platform-filters?
api-platform-filters 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.