dev-toolings/superpowers-symfony118 installs
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
How do I install this agent skill?
npx skills add https://github.com/dev-toolings/superpowers-symfony --skill api-platform-filtersIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides documentation and code templates for implementing API Platform filters in Symfony projects. It follows security best practices, such as using parameterized queries to prevent SQL injection and recommending strict input validation. No malicious behaviors or suspicious code patterns were detected.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
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 withapi:upgrade-filter.
Default workflow
- Declare
parameterswithQueryParameteron the operation; keep#[ApiFilter]only in 3.4 code or code not yet migrated. - 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+). - For a custom filter, implement
FilterInterfaceand read the bound value from$context['parameter'](AbstractFilterandfilterProperty()are deprecated since 4.4: keep them for 4.3 and 3.4 code). - Turn on
strictQueryParameterValidationso unknown query parameters return 400. - 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()andsetParameter(), 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
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/dev-toolings/superpowers-symfony/api-platform-filters">View api-platform-filters on skillZs</a>