File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ use ApiPlatform\JsonLd\Serializer\ObjectNormalizer as JsonLdObjectNormalizer;
57
57
use ApiPlatform\JsonLd\ContextBuilder as JsonLdContextBuilder;
58
58
use ApiPlatform\JsonSchema\SchemaFactory;
59
59
use ApiPlatform\JsonSchema\TypeFactory;
60
+ use ApiPlatform\Metadata\ApiResource;
60
61
use ApiPlatform\Metadata\CollectionOperationInterface;
61
62
use ApiPlatform\Metadata\HttpOperation;
62
63
use ApiPlatform\Metadata\Operation;
@@ -257,7 +258,7 @@ $providerCollection = new class implements ContainerInterface {
257
258
}
258
259
259
260
public function has($id): bool {
260
- return isset($this->providers['id' ]);
261
+ return isset($this->providers[$id ]);
261
262
}
262
263
};
263
264
$stateProviders = new CallableProvider($providerCollection);
@@ -289,6 +290,12 @@ class Validator implements ValidatorInterface {
289
290
$validator = new Validator(Validation::createValidator());
290
291
$validateListener = new ValidateListener($validator, $resourceMetadataFactory);
291
292
293
+ #[ApiResource(provider: \BookProvider::class)]
294
+ class Book
295
+ {
296
+ public int $id;
297
+ }
298
+
292
299
class BookProvider implements ProviderInterface
293
300
{
294
301
public function provide(Operation $operation, array $uriVariables = [], array $context = []): object|array|null
You can’t perform that action at this time.
0 commit comments