mcpField
A
api-platform-resources

api-platform-resources

github.com/dev-toolingsDevelopment22779 installsUpdated 3w ago
Repository

About api-platform-resources

A Symfony development skill for defining API Platform resources and their operations. It guides CRUD selection, pagination, and typed OpenAPI documentation, with version-specific configuration cautions.

Key features

  1. 01Explicit resource operation lists
  2. 02Route and URI configuration guidance
  3. 03Pagination configuration
  4. 04Typed OpenAPI documentation
  5. 05Validation group guidance

Use cases

  1. 01Expose an entity as an API resource
  2. 02Control available CRUD operations
  3. 03Configure collection pagination and API docs

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/dev-toolings/superpowers-symfony --skill api-platform-resources

After installing, type/api-platform-resourcesin Claude Code to confirm it loaded.

Bundled filesreference.md

Details

From the project README

Api Platform Resources (Symfony)

Use when

  • Exposing a new entity or class as an #[ApiResource].
  • Choosing exactly which of Get, GetCollection, Post, Put, Patch, and Delete the API offers.
  • Tuning collection pagination (items per page, partial pagination, client control).
  • Documenting operations with typed OpenAPI objects instead of openapiContext arrays.

Default workflow

  1. Install only the components you need: api-platform/symfony, api-platform/doctrine-orm, and optionally api-platform/graphql; on Symfony 6.4 LTS, pin them to ~4.3.0.
  2. List every operation in operations:, since declaring any one stops the automatic CRUD, and Put is never automatic.
  3. Set uriTemplate, requirements, status, or routePrefix only where the defaults do not fit.
  4. Configure pagination through resource attributes or api_platform.defaults in config/packages/api_platform.yaml.
  5. Describe operations with openapi: model objects, set validationContext groups, then check the routes and the OpenAPI export.

Guardrails

  • Declaring one operation removes the default CRUD: an operations: [new Get()] resource has no collection, Post, or Delete.
  • openapiContext arrays are deprecated in v4: use the typed openapi: option.
  • collectionOperations and itemOperations no longer exist.
  • paginationClientEnabled lets clients disable pagination: keep paginationMaximumItemsPerPage set.

Progressive disclosure

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

Output contract

  • The resource class with its explicit operation list and the routes it produces.
  • Pagination and OpenAPI settings, with the reason for each override.
  • Route listing and test results for each declared operation.

References

  • reference.md

Comments

Markdown supported