api-platform / api-platform/core

Accept absolute URLs for ApiResource URI template.

Open
#7,339 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
2.6k
Forks
980
Avg merge
2d 5h
Merged PRs (30d)
48

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**

```php
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`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.