Skip to content

Fix template resource config filename and item uriTemplate#141

Open
curler7 wants to merge 1 commit intoSylius:1.1from
curler7:fix/template-resource-path
Open

Fix template resource config filename and item uriTemplate#141
curler7 wants to merge 1 commit intoSylius:1.1from
curler7:fix/template-resource-path

Conversation

@curler7
Copy link
Copy Markdown

@curler7 curler7 commented Feb 20, 2026

[BC] Rename Template resource config file and unify shop template item URI

Description

This PR introduces two changes to the CMS Template shop API resource configuration:

  1. Renames the incorrectly named file:

    • Tempalate.xmlTemplate.xml
  2. Updates the item operation uriTemplate from:

    • /shop/cms/template/{id}
      to:
    • /shop/cms/templates/{id}

The goal is to align the item endpoint with the collection endpoint:

  • Collection: /shop/cms/templates
  • Item (after change): /shop/cms/templates/{id}

Rationale

  • The filename currently contains a typo.
  • The item endpoint uses a singular form (template) while the collection uses a plural form (templates).
  • This change makes the API structure consistent and predictable.

⚠️ Backward Compatibility

This change modifies a public API endpoint:
/shop/cms/template/{id}

is replaced by:
/shop/cms/templates/{id}

If the singular endpoint is already used in production integrations, this constitutes a backward compatibility break.

Please advise whether:

  • This should target a major version only, or
  • A deprecation path should be introduced instead.

How to verify

  1. Install CmsPlugin in a Sylius project.
  2. Clear cache.
  3. Run:
    bin/console debug:router | grep cms

Expected output includes:
/shop/cms/templates
/shop/cms/templates/{id}

  1. Ensure API Platform metadata loads without errors.

Checklist

  • XML is valid
  • No duplicate route definitions
  • Follows API Platform metadata structure
  • BC impact documented

@curler7 curler7 requested a review from a team as a code owner February 20, 2026 01:51
Copy link
Copy Markdown
Member

@crydotsnake crydotsnake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest adding this to the next major version (1.2). Same as #123 - this contains also a BC change.

@crydotsnake crydotsnake added API APIs related issues and PRs. BC Break PRs introducing BC breaks (do not even try to merge). labels May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API APIs related issues and PRs. BC Break PRs introducing BC breaks (do not even try to merge).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants