Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Accept absolute URLs for ApiResource URI template.

Open
#7,339 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
api

Research direction

Start by tracing how ApiResource uriTemplate values are turned into generated IRIs, then inspect the related tests or add coverage for an absolute template. Done means a template such as https://remote.api/custom/api/brands/{id} produces the absolute URL without a local /api/ prefix.

Written by the indexing model from the issue text.

Description

Description

If the API use a remote API for a relation (with a local database cache), it would be a nice features for IRIs to point to the resource on the remote API:

Example

use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;

#[ApiResource(
    uriTemplate: 'https://remote.api/custom/api/brands/{id}',
    provider: null,
)]
#[Get]
final readonly class Brand
{

With API Platform 4.1.11, this generates /api/https://remote.api/custom/api/brands/d1d08e37-1234-4567-918c-354b6b210ae1.

It would be nice to allow it to generate https://remote.api/custom/api/brands/d1d08e37-1234-4567-918c-354b6b210ae1

Dominant language
PHP
Stars
2.6k
Forks
989
Avg merge
1d 23h
Merged PRs (30d)
102

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from api-platform/core

All issues in api-platform/core

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.