Skip to content

extension create store-api-route generates a discoverable Store API route in an existing plugin #1298

Description

User story

As a plugin developer, I want to generate a Store API route and its required registration together, so that the endpoint is discovered without manually coordinating several files.

Problem

A Store API route requires several coordinated artifacts, including its route contract, concrete implementation, response class, route metadata, service registration, and route import.

Each PHP class can be valid independently while the endpoint remains unavailable because route names, paths, scopes, services, or imports are missing or inconsistent.

The generator should create one minimal Store API endpoint using conventions supported by the plugin's target Shopware version. It should provide the same functional capability as the current Core scaffolder while safely adding it to a plugin that already contains user code.

Implementation decisions

  • How the route class name, route name, path, and HTTP method are provided or derived.
  • Whether an abstract route contract and dedicated response class are always generated.
  • Which route attributes, scopes, and registration conventions apply to each supported Shopware version.
  • How the generator detects and updates the plugin's existing service and route configuration.
  • Whether the generated route has no dependencies or includes an optional example dependency.
  • How class, route-name, route-path, service, and import conflicts are handled.
  • How Store API discovery and execution of the generated endpoint are verified.

Out of scope

  • Plugin-specific business logic or repository queries
  • Request payload validation
  • Storefront or Administration controllers
  • Generating Store API client code

Acceptance criteria

  • The generated Store API endpoint is discovered and can be called on every Shopware version the generator claims to support.
  • Existing code and configuration are preserved, and route, class, or registration conflicts are reported before writing.

Readiness checklist

  • Acceptance criteria are clearly defined.
  • Backward compatibility impact addressed.
  • Documentation written.
  • Tests added or adjusted accordingly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Story.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions