Skip to content

Commit eacb4b3

Browse files
Merge pull request #1575 from vincentchalamon/docs/metadata-v3
docs: remove ApiPlatform\Core occurrences
2 parents 3254b46 + d4dc7ec commit eacb4b3

24 files changed

+99
-118
lines changed

admin/handling-relations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ For instance, if your API returns:
8888
"hydra:member": [
8989
{
9090
"@id": "/books/07b90597-542e-480b-a6bf-5db223c761aa",
91-
"@type": "http://schema.org/Book",
91+
"@type": "https://schema.org/Book",
9292
"title": "War and Peace",
9393
"author": {
9494
"@id": "/authors/d7a133c1-689f-4083-8cfc-afa6d867f37d",
95-
"@type": "http://schema.org/Author",
95+
"@type": "https://schema.org/Author",
9696
"firstName": "Leo",
9797
"lastName": "Tolstoi"
9898
}

admin/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ You can **customize everything** by using provided React Admin and [MUI](https:/
2222
* Automatically generates an admin interface for all the resources of the API thanks to the hypermedia features of Hydra or to the OpenAPI documentation
2323
* Generates 'list', 'create', 'show', and 'edit' screens, as well as a delete button
2424
* Generates suitable inputs and fields according to the API doc (e.g. number HTML input for numbers, checkbox for booleans, selectbox for relationships...)
25-
* Generates suitable inputs and fields according to Schema.org types if available (e.g. email field for `http://schema.org/email`)
25+
* Generates suitable inputs and fields according to Schema.org types if available (e.g. email field for `https://schema.org/email`)
2626
* Handles relationships
2727
* Supports pagination
2828
* Supports filters and ordering

admin/schema.org.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ The following examples will use [API Platform Core](../core/) to create such API
1212
By default, IRIs of related objects are displayed in lists and forms.
1313
However, it is often more user-friendly to display a string representation of the resource (such as its name) instead of its ID.
1414

15-
To configure which property should be shown to represent your entity, map the property containing the name of the object with the `http://schema.org/name` type:
15+
To configure which property should be shown to represent your entity, map the property containing the name of the object with the `https://schema.org/name` type:
1616

1717
```php
1818
// api/src/Entity/Person.php
1919
...
2020

21-
#[ApiProperty(types: ["http://schema.org/name"])]
21+
#[ApiProperty(types: ["https://schema.org/name"])]
2222
private $name;
2323

2424
...
@@ -30,8 +30,8 @@ Besides, it is also possible to use the documentation to customize some fields a
3030

3131
The following Schema.org types are currently supported by API Platform Admin:
3232

33-
* `http://schema.org/email`: the field will be rendered using the `<EmailField>` React Admin component
34-
* `http://schema.org/url`: the field will be rendered using the `<UrlField>` React Admin component
35-
* `http://schema.org/identifier`: the field will be formatted properly in inputs
33+
* `https://schema.org/email`: the field will be rendered using the `<EmailField>` React Admin component
34+
* `https://schema.org/url`: the field will be rendered using the `<UrlField>` React Admin component
35+
* `https://schema.org/identifier`: the field will be formatted properly in inputs
3636

3737
Note: if you already use validation on your properties, the semantics are already configured correctly (see [the correspondence table](../core/validation.md#open-vocabulary-generated-from-validation-metadata))!

core/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@ api_platform:
242242
Symfony\Component\Serializer\Exception\ExceptionInterface: 400
243243

244244
# Or with a constant defined in the 'Symfony\Component\HttpFoundation\Response' class.
245-
ApiPlatform\Core\Exception\InvalidArgumentException: !php/const Symfony\Component\HttpFoundation\Response::HTTP_BAD_REQUEST
245+
ApiPlatform\Exception\InvalidArgumentException: !php/const Symfony\Component\HttpFoundation\Response::HTTP_BAD_REQUEST
246246

247-
ApiPlatform\Core\Exception\FilterValidationException: 400
247+
ApiPlatform\Exception\FilterValidationException: 400
248248

249249
Doctrine\ORM\OptimisticLockException: 409
250250

@@ -371,7 +371,7 @@ api_platform:
371371
stateless: ~
372372

373373
# The URL generation strategy to use for IRIs
374-
url_generation_strategy: !php/const ApiPlatform\Core\Api\UrlGeneratorInterface::ABS_PATH
374+
url_generation_strategy: !php/const ApiPlatform\Api\UrlGeneratorInterface::ABS_PATH
375375

376376
# ...
377377
```

core/events.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Attribute | Type | Default | Description
6161

6262
Registering your own event listeners to add extra logic is convenient.
6363

64-
The [`ApiPlatform\Core\EventListener\EventPriorities`](https://github.com/api-platform/core/blob/main/src/Symfony/EventListener/EventPriorities.php) class comes with a convenient set of class constants corresponding to commonly used priorities:
64+
The [`ApiPlatform\Symfony\EventListener\EventPriorities`](https://github.com/api-platform/core/blob/main/src/Symfony/EventListener/EventPriorities.php) class comes with a convenient set of class constants corresponding to commonly used priorities:
6565

6666
Constant | Event | Priority |
6767
-------------------|-------------------|----------|
@@ -86,7 +86,7 @@ In the following example, we will send a mail each time a new book is created us
8686

8787
namespace App\EventSubscriber;
8888

89-
use ApiPlatform\Core\EventListener\EventPriorities;
89+
use ApiPlatform\Symfony\EventListener\EventPriorities;
9090
use App\Entity\Book;
9191
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
9292
use Symfony\Component\HttpFoundation\Request;

core/extending-jsonld-context.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ namespace App\Entity;
1616
use ApiPlatform\Metadata\ApiProperty;
1717
use ApiPlatform\Metadata\ApiResource;
1818

19-
#[ApiResource(types: ['http://schema.org/Book'])]
19+
#[ApiResource(types: ['https://schema.org/Book'])]
2020
class Book
2121
{
2222
// ...
2323

2424
#[ApiProperty(
25-
types: ['http://schema.org/name'],
25+
types: ['https://schema.org/name'],
2626
jsonldContext: [
2727
'@id' => 'http://yourcustomid.com',
2828
'@type' => 'http://www.w3.org/2001/XMLSchema#string',

core/extensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Extensions are specific to Doctrine and Elasticsearch-PHP, and therefore, the Do
66
reading support must be enabled to use this feature. If you use custom providers it's up to you to implement your own
77
extension system or not.
88

9-
You can find a working example of a custom data provider using a pagination extension in the [API Platform's demo application](https://github.com/api-platform/demo/blob/master/api/src/DataProvider/Extension/TopBookPaginationExtension.php).
9+
You can find a working example of a custom extension using a pagination in the [API Platform's demo application](https://github.com/api-platform/demo/blob/main/api/src/State/Extension/TopBookPaginationExtension.php).
1010

1111
## Custom Doctrine ORM Extension
1212

core/external-vocabularies.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ namespace App\Entity;
1313
use ApiPlatform\Metadata\ApiProperty;
1414
use ApiPlatform\Metadata\ApiResource;
1515

16-
#[ApiResource(types: ['http://schema.org/Book'])]
16+
#[ApiResource(types: ['https://schema.org/Book'])]
1717
class Book
1818
{
1919
// ...
2020

21-
#[ApiProperty(types: ['http://schema.org/name'])]
21+
#[ApiProperty(types: ['https://schema.org/name'])]
2222
public $name;
2323

2424
// ...
@@ -57,17 +57,17 @@ Built-in mapping is:
5757

5858
Constraints | Schema.org type |
5959
---------------------------------------------------- |-----------------------------------|
60-
`Symfony\Component\Validator\Constraints\Url` | `http://schema.org/url` |
61-
`Symfony\Component\Validator\Constraints\Email` | `http://schema.org/email` |
62-
`Symfony\Component\Validator\Constraints\Uuid` | `http://schema.org/identifier` |
63-
`Symfony\Component\Validator\Constraints\CardScheme` | `http://schema.org/identifier` |
64-
`Symfony\Component\Validator\Constraints\Bic` | `http://schema.org/identifier` |
65-
`Symfony\Component\Validator\Constraints\Iban` | `http://schema.org/identifier` |
66-
`Symfony\Component\Validator\Constraints\Date` | `http://schema.org/Date` |
67-
`Symfony\Component\Validator\Constraints\DateTime` | `http://schema.org/DateTime` |
68-
`Symfony\Component\Validator\Constraints\Time` | `http://schema.org/Time` |
69-
`Symfony\Component\Validator\Constraints\Image` | `http://schema.org/image` |
70-
`Symfony\Component\Validator\Constraints\File` | `http://schema.org/MediaObject` |
71-
`Symfony\Component\Validator\Constraints\Currency` | `http://schema.org/priceCurrency` |
72-
`Symfony\Component\Validator\Constraints\Isbn` | `http://schema.org/isbn` |
73-
`Symfony\Component\Validator\Constraints\Issn` | `http://schema.org/issn` |
60+
`Symfony\Component\Validator\Constraints\Url` | `https://schema.org/url` |
61+
`Symfony\Component\Validator\Constraints\Email` | `https://schema.org/email` |
62+
`Symfony\Component\Validator\Constraints\Uuid` | `https://schema.org/identifier` |
63+
`Symfony\Component\Validator\Constraints\CardScheme` | `https://schema.org/identifier` |
64+
`Symfony\Component\Validator\Constraints\Bic` | `https://schema.org/identifier` |
65+
`Symfony\Component\Validator\Constraints\Iban` | `https://schema.org/identifier` |
66+
`Symfony\Component\Validator\Constraints\Date` | `https://schema.org/Date` |
67+
`Symfony\Component\Validator\Constraints\DateTime` | `https://schema.org/DateTime` |
68+
`Symfony\Component\Validator\Constraints\Time` | `https://schema.org/Time` |
69+
`Symfony\Component\Validator\Constraints\Image` | `https://schema.org/image` |
70+
`Symfony\Component\Validator\Constraints\File` | `https://schema.org/MediaObject` |
71+
`Symfony\Component\Validator\Constraints\Currency` | `https://schema.org/priceCurrency` |
72+
`Symfony\Component\Validator\Constraints\Isbn` | `https://schema.org/isbn` |
73+
`Symfony\Component\Validator\Constraints\Issn` | `https://schema.org/issn` |

core/file-upload.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ use Vich\UploaderBundle\Mapping\Annotation as Vich;
7272
#[ORM\Entity]
7373
#[ApiResource(
7474
normalizationContext: ['groups' => ['media_object:read']],
75-
types: ['http://schema.org/MediaObject'],
75+
types: ['https://schema.org/MediaObject'],
7676
operations: [
7777
new Get(),
7878
new GetCollection(),
@@ -105,7 +105,7 @@ class MediaObject
105105
#[ORM\Id, ORM\Column, ORM\GeneratedValue]
106106
private ?int $id = null;
107107
108-
#[ApiProperty(types: ['http://schema.org/contentUrl'])]
108+
#[ApiProperty(types: ['https://schema.org/contentUrl'])]
109109
#[Groups(['media_object:read'])]
110110
public ?string $contentUrl = null;
111111
@@ -218,7 +218,7 @@ your data, you will get a response looking like this:
218218

219219
```json
220220
{
221-
"@type": "http://schema.org/MediaObject",
221+
"@type": "https://schema.org/MediaObject",
222222
"@id": "/media_objects/<id>",
223223
"contentUrl": "<url>"
224224
}
@@ -257,14 +257,14 @@ use Symfony\Component\HttpFoundation\File\File;
257257
use Vich\UploaderBundle\Mapping\Annotation as Vich;
258258

259259
#[ORM\Entity]
260-
#[ApiResource(types: ['http://schema.org/Book'])]
260+
#[ApiResource(types: ['https://schema.org/Book'])]
261261
class Book
262262
{
263263
// ...
264264

265265
#[ORM\ManyToOne(targetEntity: MediaObject::class)]
266266
#[ORM\JoinColumn(nullable: true)]
267-
#[ApiProperty(types: ['http://schema.org/image'])]
267+
#[ApiProperty(types: ['https://schema.org/image'])]
268268
public ?MediaObject $image = null;
269269

270270
// ...
@@ -363,7 +363,7 @@ use Vich\UploaderBundle\Mapping\Annotation as Vich;
363363
#[ApiResource(
364364
normalizationContext: ['groups' => ['book:read']],
365365
denormalizationContext: ['groups' => ['book:write']],
366-
types: ['http://schema.org/Book'],
366+
types: ['https://schema.org/Book'],
367367
operations: [
368368
new GetCollection(),
369369
new Post(inputFormats: ['multipart' => ['multipart/form-data']])
@@ -373,7 +373,7 @@ class Book
373373
{
374374
// ...
375375

376-
#[ApiProperty(types: ['http://schema.org/contentUrl'])]
376+
#[ApiProperty(types: ['https://schema.org/contentUrl'])]
377377
#[Groups(['book:read'])]
378378
public ?string $contentUrl = null;
379379

core/form-data.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ This decorator is able to denormalize posted form data to the target object. In
1717

1818
namespace App\EventListener;
1919

20-
use ApiPlatform\Core\Util\RequestAttributesExtractor;
20+
use ApiPlatform\Serializer\SerializerContextBuilderInterface;
21+
use ApiPlatform\Symfony\EventListener\DeserializeListener as DecoratedListener;
22+
use ApiPlatform\Util\RequestAttributesExtractor;
2123
use Symfony\Component\HttpFoundation\Request;
2224
use Symfony\Component\HttpKernel\Event\RequestEvent;
23-
use ApiPlatform\Core\EventListener\DeserializeListener as DecoratedListener;
2425
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
25-
use ApiPlatform\Core\Serializer\SerializerContextBuilderInterface;
2626

2727
final class DeserializeListener
2828
{

0 commit comments

Comments
 (0)