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
{

core/getting-started.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ use Symfony\Component\Validator\Constraints as Assert;
111111
*
112112
*/
113113
#[ORM\Entity]
114-
#[ApiResource(types: ['http://schema.org/Offer'])]
114+
#[ApiResource(types: ['https://schema.org/Offer'])]
115115
class Offer
116116
{
117117
#[ORM\Id, ORM\Column, ORM\GeneratedValue]
@@ -173,7 +173,7 @@ resources:
173173
App\Entity\Offer:
174174
shortName: 'Offer' # optional
175175
description: 'An offer from my shop' # optional
176-
types: ['http://schema.org/Offer'] # optional
176+
types: ['https://schema.org/Offer'] # optional
177177
paginationItemsPerPage: 25 # optional
178178
```
179179
@@ -192,7 +192,7 @@ resources:
192192
description="An offer from my shop" <!-- optional -->
193193
>
194194
<types>
195-
<type>http://schema.org/Offer</type> <!-- optional -->
195+
<type>https://schema.org/Offer</type> <!-- optional -->
196196
</types>
197197
</resource>
198198
</resources>

core/graphql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,7 @@ use Vich\UploaderBundle\Mapping\Annotation as Vich;
19771977
#[ORM\Entity]
19781978
#[ApiResource(
19791979
normalizationContext: ['groups' => ['media_object_read']],
1980-
types: ['http://schema.org/MediaObject'],
1980+
types: ['https://schema.org/MediaObject'],
19811981
graphQlOperations: [
19821982
new Mutation(
19831983
name: 'upload',
@@ -1997,7 +1997,7 @@ class MediaObject
19971997
#[ORM\Id, ORM\Column, ORM\GeneratedValue]
19981998
protected ?int $id = null;
19991999
2000-
#[ApiProperty(types: ['http://schema.org/contentUrl'])]
2000+
#[ApiProperty(types: ['https://schema.org/contentUrl'])]
20012001
#[Groups(['media_object_read'])]
20022002
public ?string $contentUrl = null;
20032003

core/jwt.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ To do it, we need to create a decorator:
198198
199199
namespace App\OpenApi;
200200
201-
use ApiPlatform\Core\OpenApi\Factory\OpenApiFactoryInterface;
202-
use ApiPlatform\Core\OpenApi\OpenApi;
203-
use ApiPlatform\Core\OpenApi\Model;
201+
use ApiPlatform\OpenApi\Factory\OpenApiFactoryInterface;
202+
use ApiPlatform\OpenApi\OpenApi;
203+
use ApiPlatform\OpenApi\Model;
204204
205205
final class JwtDecorator implements OpenApiFactoryInterface
206206
{
@@ -302,7 +302,7 @@ To test your authentication with `ApiTestCase`, you can write a method as below:
302302
303303
namespace App\Tests;
304304
305-
use ApiPlatform\Core\Bridge\Symfony\Bundle\Test\ApiTestCase;
305+
use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
306306
use App\Entity\User;
307307
use Hautelook\AliceBundle\PhpUnit\ReloadDatabaseTrait;
308308

core/messenger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ We use the `status` attribute to configure API Platform to return a [202 Accepte
7272
It indicates that the request has been received and will be treated later, without giving an immediate return to the client.
7373
Finally, the `output` attribute is set to `false`, so the HTTP response that will be generated by API Platform will be empty, and the [serialization process](serialization.md) will be skipped.
7474

75-
**Note:** when using `messenger=true` ApiResource attribute in a Doctrine entity, the Doctrine DataPersister is not called. If you want the Doctrine DataPersister to be called, you should implement a `ResumableDataPersisterInterface` [documented here](data-persisters.md).
75+
**Note:** when using `messenger=true` ApiResource attribute in a Doctrine entity, the Doctrine Processor is not called. If you want the Doctrine Processor to be called, you should [decorate a built-in state processor](state-processors.md#decorating-the-built-in-state-processors) and implement your own logic.
7676

7777
## Registering a Message Handler
7878

core/mongodb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ use Symfony\Component\Validator\Constraints as Assert;
169169
/**
170170
* @ODM\Document
171171
*/
172-
#[ApiResource(types: ['http://schema.org/Offer'])]
172+
#[ApiResource(types: ['https://schema.org/Offer'])]
173173
class Offer
174174
{
175175
/**

core/operation-path-naming.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ Let's assume we need URLs without separators (e.g. `api.tld/myresources`)
2727

2828
### Defining the Operation Segment Name Generator
2929

30-
Make sure the custom segment generator implements [`ApiPlatform\Core\Operation\PathSegmentNameGeneratorInterface`](https://github.com/api-platform/core/blob/main/src/Operation/PathSegmentNameGeneratorInterface.php):
30+
Make sure the custom segment generator implements [`ApiPlatform\Operation\PathSegmentNameGeneratorInterface`](https://github.com/api-platform/core/blob/main/src/Operation/PathSegmentNameGeneratorInterface.php):
3131

3232
```php
3333
<?php
3434
// api/src/Operation/SingularPathSegmentNameGenerator.php
3535
namespace App\Operation;
3636
37-
use ApiPlatform\Core\Operation\PathSegmentNameGeneratorInterface;
37+
use ApiPlatform\Operation\PathSegmentNameGeneratorInterface;
3838
3939
class SingularPathSegmentNameGenerator implements PathSegmentNameGeneratorInterface
4040
{

core/pagination.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ is returned. It's a valid JSON(-LD) document containing items of the requested p
2020
"hydra:member": [
2121
{
2222
"@id": "/books/1",
23-
"@type": "http://schema.org/Book",
23+
"@type": "https://schema.org/Book",
2424
"name": "My awesome book"
2525
},
2626
{

core/serialization.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ In the above example, you will receive the book's data like this:
548548
{
549549
"@context": "/contexts/Book",
550550
"@id": "/books/3",
551-
"@type": "http://schema.org/Book",
551+
"@type": "https://schema.org/Book",
552552
"publicationDate": "1989-06-16"
553553
}
554554
```
@@ -1074,8 +1074,8 @@ The JSON output will now include the embedded context:
10741074
"@context": {
10751075
"@vocab": "http://localhost:8000/apidoc#",
10761076
"hydra": "http://www.w3.org/ns/hydra/core#",
1077-
"name": "http://schema.org/name",
1078-
"author": "http://schema.org/author"
1077+
"name": "https://schema.org/name",
1078+
"author": "https://schema.org/author"
10791079
},
10801080
"@id": "/books/62",
10811081
"@type": "Book",

0 commit comments

Comments
 (0)