Skip to content

Commit 18189f0

Browse files
Merge branch '2.6' into main
2 parents dc0a421 + 17af024 commit 18189f0

File tree

8 files changed

+37
-14
lines changed

8 files changed

+37
-14
lines changed

core/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ api_platform:
123123
# The OAuth flow grant type.
124124
flow: 'application'
125125

126-
# The OAuth token URL.
127-
tokenUrl: '/oauth/v2/token'
126+
# The OAuth token URL. Make sure to check the specification tokenUrl is not needed for an implicit flow.
127+
tokenUrl: ''
128128

129129
# The OAuth authentication URL.
130-
authorizationUrl: '/oauth/v2/auth'
130+
authorizationUrl: ''
131131

132132
# The OAuth scopes.
133133
scopes: []

core/filters.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,10 +1209,12 @@ final class RegexpFilter extends AbstractFilter
12091209
'property' => $property,
12101210
'type' => Type::BUILTIN_TYPE_STRING,
12111211
'required' => false,
1212-
'swagger' => [
1213-
'description' => 'Filter using a regex. This will appear in the Swagger documentation!',
1214-
'name' => 'Custom name to use in the Swagger documentation',
1215-
'type' => 'Will appear below the name in the Swagger documentation',
1212+
'description' => 'Filter using a regex. This will appear in the OpenApi documentation!',
1213+
'openapi' => [
1214+
'example' => 'Custom example that will be in the documentation and be the default value of the sandbox',
1215+
'allowReserved' => false,// if true, query parameters will be not percent-encoded
1216+
'allowEmptyValue' => true,
1217+
'explode' => false, // to be true, the type must be Type::BUILTIN_TYPE_ARRAY, ?product=blue,green will be ?product=blue&product=green
12161218
],
12171219
];
12181220
}

core/graphql.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,6 +1832,7 @@ Your class needs to look like this:
18321832
namespace App\Type;
18331833
18341834
use ApiPlatform\GraphQl\Type\TypeConverterInterface;
1835+
use ApiPlatform\Metadata\GraphQl\Operation;
18351836
use App\Entity\Book;
18361837
use GraphQL\Type\Definition\Type as GraphQLType;
18371838
use Symfony\Component\PropertyInfo\Type;
@@ -1848,15 +1849,15 @@ final class TypeConverter implements TypeConverterInterface
18481849
/**
18491850
* {@inheritdoc}
18501851
*/
1851-
public function convertType(Type $type, bool $input, ?string $queryName, ?string $mutationName, string $resourceClass, string $rootResource, ?string $property, int $depth)
1852+
public function convertType(Type $type, bool $input, Operation $rootOperation, string $resourceClass, string $rootResource, ?string $property, int $depth)
18521853
{
18531854
if ('publicationDate' === $property
18541855
&& Book::class === $resourceClass
18551856
) {
18561857
return 'DateTime';
18571858
}
18581859
1859-
return $this->defaultTypeConverter->convertType($type, $input, $queryName, $mutationName, $resourceClass, $rootResource, $property, $depth);
1860+
return $this->defaultTypeConverter->convertType($type, $input, $rootOperation, $resourceClass, $rootResource, $property, $depth);
18601861
}
18611862
18621863
/**

core/jwt.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,18 @@ security:
154154
- { path: ^/, roles: IS_AUTHENTICATED_FULLY }
155155
```
156156

157+
### Be sure to have lexik_jwt_authentication configured on your user_identity_field
158+
159+
```yaml
160+
# api/config/packages/lexik_jwt_authentication.yaml
161+
lexik_jwt_authentication:
162+
secret_key: '%env(resolve:JWT_SECRET_KEY)%'
163+
public_key: '%env(resolve:JWT_PUBLIC_KEY)%'
164+
pass_phrase: '%env(JWT_PASSPHRASE)%'
165+
166+
user_identity_field: email # Or the field you have setted using make:user
167+
```
168+
157169
## Documenting the Authentication Mechanism with Swagger/Open API
158170

159171
Want to test the routes of your JWT-authentication-protected API?
@@ -271,6 +283,7 @@ final class JwtDecorator implements OpenApiFactoryInterface
271283
],
272284
]),
273285
),
286+
security: [],
274287
),
275288
);
276289
$openApi->getPaths()->addPath('/authentication_token', $pathItem);

core/mongodb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class Offer
202202
}
203203
```
204204

205-
When defining references, always use the id for storing them instead of the native [DBRef](https://docs.mongodb.com/manual/reference/database-references/#dbrefs).
205+
When defining references, always use the ID for storing them instead of the native [DBRef](https://docs.mongodb.com/manual/reference/database-references/#dbrefs).
206206
It allows API Platform to manage [filtering on nested properties](filters.md#apifilter-annotation) by using [lookups](https://docs.mongodb.com/manual/reference/operator/aggregation/lookup/).
207207

208208
## Filtering

core/serialization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,9 +1052,9 @@ final class ApiNormalizer implements NormalizerInterface, DenormalizerInterface,
10521052
return $this->decorated->supportsDenormalization($data, $type, $format);
10531053
}
10541054
1055-
public function denormalize($data, $class, $format = null, array $context = [])
1055+
public function denormalize($data, string $type, string $format = null, array $context = [])
10561056
{
1057-
return $this->decorated->denormalize($data, $class, $format, $context);
1057+
return $this->decorated->denormalize($data, $type, $format, $context);
10581058
}
10591059
10601060
public function setSerializer(SerializerInterface $serializer)

extra/philosophy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ API Platform makes modern development easy and fun again:
2929
be understood by any compliant client such as your apps but also search engines (JSON-LD with Schema.org vocabulary).
3030
This API is the central and unique entry point to access and modify data. It also encapsulates the whole business logic.
3131
* [Then **create as many clients as you want using frontend technologies you love**](../client-generator/index.md): a JavaScript
32-
webapp built in React or in Vue querying the API but also a native iOS or Android app, or even a desktop application. Clients
32+
webapp built with React or with Vue querying the API but also a native iOS or Android app, or even a desktop application. Clients
3333
only display data and forms.
3434

3535
See also [the general design](../core/design.md) of the framework.

schema-generator/configuration.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,20 @@ It allows to specify interfaces and `abstract` classes in relation mappings.
440440
If you set the option `useInterface` to true, the generator will generate an interface corresponding to each generated
441441
entity and will use them in relation mappings.
442442

443-
To let the schema generator generate the XML mapping file usable with Symfony, add the following to your config file:
443+
To let the schema generator generate the mapping file usable with Symfony, add the following to your config file:
444444

445445
```yaml
446446
doctrine:
447447
resolveTargetEntityConfigPath: path/to/doctrine.xml
448448
```
449449

450+
The default mapping file format is XML, but you can change it to YAML with the following option:
451+
```yaml
452+
doctrine:
453+
resolveTargetEntityConfigPath: path/to/doctrine.yaml
454+
resolveTargetEntityConfigType: YAML # Supports XML & YAML
455+
```
456+
450457
### Doctrine Resolve Target Entity Config Type
451458

452459
By default, the mapping file is in XML. If you want to have a YAML file, add the following:

0 commit comments

Comments
 (0)