From 6d049cfc932a300e795d10779b830552e9d4fb25 Mon Sep 17 00:00:00 2001 From: Maxcastel Date: Fri, 3 Apr 2026 16:28:35 +0200 Subject: [PATCH 1/9] feat: add operation to hydra response --- .../Serializer/DocumentationNormalizer.php | 102 +------------- src/Hydra/Serializer/HydraOperationsTrait.php | 127 ++++++++++++++++++ src/JsonLd/Serializer/ItemNormalizer.php | 24 ++++ 3 files changed, 152 insertions(+), 101 deletions(-) create mode 100644 src/Hydra/Serializer/HydraOperationsTrait.php diff --git a/src/Hydra/Serializer/DocumentationNormalizer.php b/src/Hydra/Serializer/DocumentationNormalizer.php index 428c6da7a9..7cf342a156 100644 --- a/src/Hydra/Serializer/DocumentationNormalizer.php +++ b/src/Hydra/Serializer/DocumentationNormalizer.php @@ -21,7 +21,6 @@ use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\CollectionOperationInterface; use ApiPlatform\Metadata\ErrorResource; -use ApiPlatform\Metadata\HttpOperation; use ApiPlatform\Metadata\Operation; use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface; use ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface; @@ -48,6 +47,7 @@ */ final class DocumentationNormalizer implements NormalizerInterface { + use HydraOperationsTrait; use HydraPrefixTrait; public const FORMAT = 'jsonld'; @@ -254,106 +254,6 @@ private function getHydraProperties(string $resourceClass, ApiResource $resource return $properties; } - /** - * Gets Hydra operations. - */ - private function getHydraOperations(bool $collection, ApiResource $resourceMetadata, string $hydraPrefix = ContextBuilder::HYDRA_PREFIX): array - { - $hydraOperations = []; - foreach ($resourceMetadata->getOperations() as $operation) { - if (true === $operation->getHideHydraOperation()) { - continue; - } - - if (('POST' === $operation->getMethod() || $operation instanceof CollectionOperationInterface) !== $collection) { - continue; - } - - $hydraOperations[] = $this->getHydraOperation($operation, $operation->getShortName(), $hydraPrefix); - } - - return $hydraOperations; - } - - /** - * Gets and populates if applicable a Hydra operation. - */ - private function getHydraOperation(HttpOperation $operation, string $prefixedShortName, string $hydraPrefix): array - { - $method = $operation->getMethod() ?: 'GET'; - - $hydraOperation = $operation->getHydraContext() ?? []; - if ($operation->getDeprecationReason()) { - $hydraOperation['owl:deprecated'] = true; - } - - $shortName = $operation->getShortName(); - $inputMetadata = $operation->getInput() ?? []; - $outputMetadata = $operation->getOutput() ?? []; - - $inputClass = \array_key_exists('class', $inputMetadata) ? $inputMetadata['class'] : false; - $outputClass = \array_key_exists('class', $outputMetadata) ? $outputMetadata['class'] : false; - - if ('GET' === $method && $operation instanceof CollectionOperationInterface) { - $hydraOperation += [ - '@type' => [$hydraPrefix.'Operation', 'schema:FindAction'], - $hydraPrefix.'description' => "Retrieves the collection of $shortName resources.", - 'returns' => null === $outputClass ? 'owl:Nothing' : $hydraPrefix.'Collection', - ]; - } elseif ('GET' === $method) { - $hydraOperation += [ - '@type' => [$hydraPrefix.'Operation', 'schema:FindAction'], - $hydraPrefix.'description' => "Retrieves a $shortName resource.", - 'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName, - ]; - } elseif ('PATCH' === $method) { - $hydraOperation += [ - '@type' => $hydraPrefix.'Operation', - $hydraPrefix.'description' => "Updates the $shortName resource.", - 'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName, - 'expects' => null === $inputClass ? 'owl:Nothing' : $prefixedShortName, - ]; - - if (null !== $inputClass) { - $possibleValue = []; - foreach ($operation->getInputFormats() ?? [] as $mimeTypes) { - foreach ($mimeTypes as $mimeType) { - $possibleValue[] = $mimeType; - } - } - - $hydraOperation['expectsHeader'] = [['headerName' => 'Content-Type', 'possibleValue' => $possibleValue]]; - } - } elseif ('POST' === $method) { - $hydraOperation += [ - '@type' => [$hydraPrefix.'Operation', 'schema:CreateAction'], - $hydraPrefix.'description' => "Creates a $shortName resource.", - 'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName, - 'expects' => null === $inputClass ? 'owl:Nothing' : $prefixedShortName, - ]; - } elseif ('PUT' === $method) { - $hydraOperation += [ - '@type' => [$hydraPrefix.'Operation', 'schema:ReplaceAction'], - $hydraPrefix.'description' => "Replaces the $shortName resource.", - 'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName, - 'expects' => null === $inputClass ? 'owl:Nothing' : $prefixedShortName, - ]; - } elseif ('DELETE' === $method) { - $hydraOperation += [ - '@type' => [$hydraPrefix.'Operation', 'schema:DeleteAction'], - $hydraPrefix.'description' => "Deletes the $shortName resource.", - 'returns' => 'owl:Nothing', - ]; - } - - $hydraOperation[$hydraPrefix.'method'] ??= $method; - $hydraOperation[$hydraPrefix.'title'] ??= strtolower($method).$shortName.($operation instanceof CollectionOperationInterface ? 'Collection' : ''); - - ksort($hydraOperation); - - return $hydraOperation; - } - /** * Gets the range of the property. */ diff --git a/src/Hydra/Serializer/HydraOperationsTrait.php b/src/Hydra/Serializer/HydraOperationsTrait.php new file mode 100644 index 0000000000..dfaa9f85bc --- /dev/null +++ b/src/Hydra/Serializer/HydraOperationsTrait.php @@ -0,0 +1,127 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace ApiPlatform\Hydra\Serializer; + +use ApiPlatform\JsonLd\ContextBuilder; +use ApiPlatform\Metadata\ApiResource; +use ApiPlatform\Metadata\CollectionOperationInterface; +use ApiPlatform\Metadata\HttpOperation; + +/** + * Generates Hydra operations for JSON-LD responses. + * + * @author Kévin Dunglas + */ +trait HydraOperationsTrait +{ + /** + * Gets Hydra operations. + */ + private function getHydraOperations(bool $collection, ApiResource $resourceMetadata, string $hydraPrefix = ContextBuilder::HYDRA_PREFIX): array + { + $hydraOperations = []; + foreach ($resourceMetadata->getOperations() as $operation) { + if (true === $operation->getHideHydraOperation()) { + continue; + } + + if (('POST' === $operation->getMethod() || $operation instanceof CollectionOperationInterface) !== $collection) { + continue; + } + + $hydraOperations[] = $this->getHydraOperation($operation, $operation->getShortName(), $hydraPrefix); + } + + return $hydraOperations; + } + + /** + * Gets and populates if applicable a Hydra operation. + */ + private function getHydraOperation(HttpOperation $operation, string $prefixedShortName, string $hydraPrefix = ContextBuilder::HYDRA_PREFIX): array + { + $method = $operation->getMethod() ?: 'GET'; + + $hydraOperation = $operation->getHydraContext() ?? []; + if ($operation->getDeprecationReason()) { + $hydraOperation['owl:deprecated'] = true; + } + + $shortName = $operation->getShortName(); + $inputMetadata = $operation->getInput() ?? []; + $outputMetadata = $operation->getOutput() ?? []; + + $inputClass = \array_key_exists('class', $inputMetadata) ? $inputMetadata['class'] : false; + $outputClass = \array_key_exists('class', $outputMetadata) ? $outputMetadata['class'] : false; + + if ('GET' === $method && $operation instanceof CollectionOperationInterface) { + $hydraOperation += [ + '@type' => [$hydraPrefix.'Operation', 'schema:FindAction'], + $hydraPrefix.'description' => "Retrieves the collection of $shortName resources.", + 'returns' => null === $outputClass ? 'owl:Nothing' : $hydraPrefix.'Collection', + ]; + } elseif ('GET' === $method) { + $hydraOperation += [ + '@type' => [$hydraPrefix.'Operation', 'schema:FindAction'], + $hydraPrefix.'description' => "Retrieves a $shortName resource.", + 'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName, + ]; + } elseif ('PATCH' === $method) { + $hydraOperation += [ + '@type' => $hydraPrefix.'Operation', + $hydraPrefix.'description' => "Updates the $shortName resource.", + 'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName, + 'expects' => null === $inputClass ? 'owl:Nothing' : $prefixedShortName, + ]; + + if (null !== $inputClass) { + $possibleValue = []; + foreach ($operation->getInputFormats() ?? [] as $mimeTypes) { + foreach ($mimeTypes as $mimeType) { + $possibleValue[] = $mimeType; + } + } + + $hydraOperation['expectsHeader'] = [['headerName' => 'Content-Type', 'possibleValue' => $possibleValue]]; + } + } elseif ('POST' === $method) { + $hydraOperation += [ + '@type' => [$hydraPrefix.'Operation', 'schema:CreateAction'], + $hydraPrefix.'description' => "Creates a $shortName resource.", + 'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName, + 'expects' => null === $inputClass ? 'owl:Nothing' : $prefixedShortName, + ]; + } elseif ('PUT' === $method) { + $hydraOperation += [ + '@type' => [$hydraPrefix.'Operation', 'schema:ReplaceAction'], + $hydraPrefix.'description' => "Replaces the $shortName resource.", + 'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName, + 'expects' => null === $inputClass ? 'owl:Nothing' : $prefixedShortName, + ]; + } elseif ('DELETE' === $method) { + $hydraOperation += [ + '@type' => [$hydraPrefix.'Operation', 'schema:DeleteAction'], + $hydraPrefix.'description' => "Deletes the $shortName resource.", + 'returns' => 'owl:Nothing', + ]; + } + + $hydraOperation[$hydraPrefix.'method'] ??= $method; + $hydraOperation[$hydraPrefix.'title'] ??= strtolower($method).$shortName.($operation instanceof CollectionOperationInterface ? 'Collection' : ''); + + ksort($hydraOperation); + + return $hydraOperation; + } +} diff --git a/src/JsonLd/Serializer/ItemNormalizer.php b/src/JsonLd/Serializer/ItemNormalizer.php index 7da1e54a21..d27af9db27 100644 --- a/src/JsonLd/Serializer/ItemNormalizer.php +++ b/src/JsonLd/Serializer/ItemNormalizer.php @@ -13,8 +13,10 @@ namespace ApiPlatform\JsonLd\Serializer; +use ApiPlatform\Hydra\Serializer\HydraOperationsTrait; use ApiPlatform\JsonLd\AnonymousContextBuilderInterface; use ApiPlatform\JsonLd\ContextBuilderInterface; +use ApiPlatform\Metadata\ErrorResourceInterface; use ApiPlatform\Metadata\Exception\ItemNotFoundException; use ApiPlatform\Metadata\HttpOperation; use ApiPlatform\Metadata\IriConverterInterface; @@ -45,6 +47,8 @@ final class ItemNormalizer extends AbstractItemNormalizer { use ClassInfoTrait; use ContextTrait; + use HydraOperationsTrait; + use HydraPrefixTrait; use JsonLdContextTrait; public const FORMAT = 'jsonld'; @@ -72,8 +76,11 @@ final class ItemNormalizer extends AbstractItemNormalizer '@vocab', ]; + private array $itemNormalizerDefaultContext = []; + public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, PropertyMetadataFactoryInterface $propertyMetadataFactory, IriConverterInterface $iriConverter, ResourceClassResolverInterface $resourceClassResolver, private readonly ContextBuilderInterface $contextBuilder, ?PropertyAccessorInterface $propertyAccessor = null, ?NameConverterInterface $nameConverter = null, ?ClassMetadataFactoryInterface $classMetadataFactory = null, array $defaultContext = [], ?ResourceAccessCheckerInterface $resourceAccessChecker = null, protected ?TagCollectorInterface $tagCollector = null, private ?OperationMetadataFactoryInterface $operationMetadataFactory = null, ?OperationResourceClassResolverInterface $operationResourceResolver = null) { + $this->itemNormalizerDefaultContext = $defaultContext; parent::__construct($propertyNameCollectionFactory, $propertyMetadataFactory, $iriConverter, $resourceClassResolver, $propertyAccessor, $nameConverter, $classMetadataFactory, $defaultContext, $resourceMetadataCollectionFactory, $resourceAccessChecker, $tagCollector, $operationResourceResolver); } @@ -110,6 +117,7 @@ public function normalize(mixed $data, ?string $format = null, array $context = // TODO: we should not remove the resource_class in the normalizeRawCollection as we would find out anyway that it's not the same as the requested one $previousResourceClass = $context['resource_class'] ?? null; $metadata = []; + $isRootResource = !isset($context['jsonld_has_context']); if ($isResourceClass = $this->resourceClassResolver->isResourceClass($resourceClass) && (null === $previousResourceClass || $this->resourceClassResolver->isResourceClass($previousResourceClass))) { $resourceClass = $this->resourceClassResolver->getResourceClass($data, $previousResourceClass); if (isset($context['operation']) && $context['operation'] instanceof HttpOperation && $context['operation']->getClass() !== $resourceClass) { @@ -184,6 +192,22 @@ public function normalize(mixed $data, ?string $format = null, array $context = $metadata['@type'] = 1 === \count($types) ? $types[0] : $types; } + if ($isResourceClass && !is_a($resourceClass, ErrorResourceInterface::class, true) && $isRootResource) { + $isCollectionRoute = $context['api_collection_sub_level'] ?? false; + $showItemHydraOperationsInCollection = $context['hydra_item_operations_in_collection'] ?? false; + + if (!$isCollectionRoute || $showItemHydraOperationsInCollection) { + $hydraOperations = $this->getHydraOperations( + false, + $this->resourceMetadataCollectionFactory->create($resourceClass)[0], + $this->getHydraPrefix($context + $this->itemNormalizerDefaultContext) + ); + if (!empty($hydraOperations)) { + $metadata['operation'] = $hydraOperations; + } + } + } + return $metadata + $normalizedData; } From 3f1eae1b7bc6f3f4d1260cba6ea9e88d856fb97d Mon Sep 17 00:00:00 2001 From: Maxcastel Date: Fri, 3 Apr 2026 16:29:27 +0200 Subject: [PATCH 2/9] feat: option --- src/Laravel/config/api-platform.php | 1 + .../Bundle/DependencyInjection/ApiPlatformExtension.php | 5 ++++- src/Symfony/Bundle/DependencyInjection/Configuration.php | 1 + .../Symfony/Bundle/DependencyInjection/ConfigurationTest.php | 3 ++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Laravel/config/api-platform.php b/src/Laravel/config/api-platform.php index 7f6c7953c9..74f4af3bf4 100644 --- a/src/Laravel/config/api-platform.php +++ b/src/Laravel/config/api-platform.php @@ -149,6 +149,7 @@ 'serializer' => [ 'hydra_prefix' => false, + 'hydra_item_operations_in_collection' => false, // 'datetime_format' => \DateTimeInterface::RFC3339, ], diff --git a/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php b/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php index 01c696c4e7..c34675ed95 100644 --- a/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php +++ b/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php @@ -332,7 +332,10 @@ private function registerCommonConfiguration(ContainerBuilder $container, array $container->setDefinition('serializer.normalizer.number', $numberNormalizerDefinition); } - $defaultContext = ['hydra_prefix' => $config['serializer']['hydra_prefix']] + ($container->hasParameter('serializer.default_context') ? $container->getParameter('serializer.default_context') : []); + $defaultContext = [ + 'hydra_prefix' => $config['serializer']['hydra_prefix'], + 'hydra_item_operations_in_collection' => $config['serializer']['hydra_item_operations_in_collection'], + ] + ($container->hasParameter('serializer.default_context') ? $container->getParameter('serializer.default_context') : []); $container->setParameter('api_platform.serializer.default_context', $defaultContext); if (!$container->hasParameter('serializer.default_context')) { diff --git a/src/Symfony/Bundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/DependencyInjection/Configuration.php index 911de422fd..c7e7a48e5b 100644 --- a/src/Symfony/Bundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/DependencyInjection/Configuration.php @@ -172,6 +172,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->addDefaultsIfNotSet() ->children() ->booleanNode('hydra_prefix')->defaultFalse()->info('Use the "hydra:" prefix.')->end() + ->booleanNode('hydra_item_operations_in_collection')->defaultFalse()->info('Include Hydra item operations on each member of a collection response. Disabled by default to reduce payload size.')->end() ->end() ->end() ->end(); diff --git a/tests/Symfony/Bundle/DependencyInjection/ConfigurationTest.php b/tests/Symfony/Bundle/DependencyInjection/ConfigurationTest.php index 9004ecb665..b7af7327ff 100644 --- a/tests/Symfony/Bundle/DependencyInjection/ConfigurationTest.php +++ b/tests/Symfony/Bundle/DependencyInjection/ConfigurationTest.php @@ -242,7 +242,8 @@ private function runDefaultConfigTests(array $doctrineIntegrationsToLoad = ['orm // TODO: remove in 5.0 'enable_link_security' => true, 'serializer' => [ - 'hydra_prefix' => null, + 'hydra_prefix' => false, + 'hydra_item_operations_in_collection' => false, ], 'enable_phpdoc_parser' => true, 'mcp' => [ From a5826297ac2766370e3eb91217a85cdde5837559 Mon Sep 17 00:00:00 2001 From: Maxcastel Date: Fri, 3 Apr 2026 16:30:53 +0200 Subject: [PATCH 3/9] fix: fix tests --- tests/Functional/BackedEnumResourceTest.php | 27 +++++++++++++++++++ tests/Functional/MathNumberTest.php | 18 +++++++++++++ .../JsonLd/Serializer/ItemNormalizerTest.php | 17 +++++++----- tests/Symfony/Bundle/Test/ApiTestCaseTest.php | 6 +++++ 4 files changed, 61 insertions(+), 7 deletions(-) diff --git a/tests/Functional/BackedEnumResourceTest.php b/tests/Functional/BackedEnumResourceTest.php index 94abdf7492..09f872c5b0 100644 --- a/tests/Functional/BackedEnumResourceTest.php +++ b/tests/Functional/BackedEnumResourceTest.php @@ -69,6 +69,15 @@ public static function providerEnumItemsJson(): iterable '@context' => '/contexts/Availability', '@id' => '/availabilities/'.$case->value, '@type' => 'Availability', + 'operation' => [ + [ + '@type' => ['hydra:Operation', 'schema:FindAction'], + 'hydra:method' => 'GET', + 'hydra:title' => 'getAvailability', + 'hydra:description' => 'Retrieves a Availability resource.', + 'returns' => 'Availability', + ], + ], 'value' => $case->value, ]]; } @@ -100,6 +109,15 @@ public static function providerEnumItemsJson(): iterable '@context' => '/contexts/AvailabilityStatus', '@id' => '/availability_statuses/'.$case->value, '@type' => 'AvailabilityStatus', + 'operation' => [ + [ + '@type' => ['hydra:Operation', 'schema:FindAction'], + 'hydra:method' => 'GET', + 'hydra:title' => 'getAvailabilityStatus', + 'hydra:description' => 'Retrieves a AvailabilityStatus resource.', + 'returns' => 'AvailabilityStatus', + ], + ], 'value' => $case->value, ]]; } @@ -457,6 +475,15 @@ public static function providerItem(): iterable '@context' => '/contexts/BackedEnumIntegerResource', '@id' => '/backed_enum_integer_resources/1', '@type' => 'BackedEnumIntegerResource', + 'operation' => [ + [ + '@type' => ['hydra:Operation', 'schema:FindAction'], + 'hydra:method' => 'GET', + 'hydra:title' => 'getBackedEnumIntegerResource', + 'hydra:description' => 'Retrieves a BackedEnumIntegerResource resource.', + 'returns' => 'BackedEnumIntegerResource', + ], + ], 'name' => 'Yes', 'value' => 1, 'description' => 'We say yes', diff --git a/tests/Functional/MathNumberTest.php b/tests/Functional/MathNumberTest.php index 04dab45903..b0c4fc657b 100644 --- a/tests/Functional/MathNumberTest.php +++ b/tests/Functional/MathNumberTest.php @@ -54,6 +54,15 @@ public function testGetMathNumber(): void '@context' => '/contexts/MathNumber', '@id' => '/math_numbers/1', '@type' => 'MathNumber', + 'operation' => [ + [ + '@type' => ['hydra:Operation', 'schema:FindAction'], + 'hydra:method' => 'GET', + 'hydra:title' => 'getMathNumber', + 'hydra:description' => 'Retrieves a MathNumber resource.', + 'returns' => 'MathNumber', + ], + ], 'id' => 1, 'value' => '300.55', ]); @@ -74,6 +83,15 @@ public function testPostMathNumber(): void '@context' => '/contexts/MathNumber', '@id' => '/math_numbers/2', '@type' => 'MathNumber', + 'operation' => [ + [ + '@type' => ['hydra:Operation', 'schema:FindAction'], + 'hydra:method' => 'GET', + 'hydra:title' => 'getMathNumber', + 'hydra:description' => 'Retrieves a MathNumber resource.', + 'returns' => 'MathNumber', + ], + ], 'id' => 2, 'value' => '120.23', ]); diff --git a/tests/JsonLd/Serializer/ItemNormalizerTest.php b/tests/JsonLd/Serializer/ItemNormalizerTest.php index d765b85a2e..ed60add58b 100644 --- a/tests/JsonLd/Serializer/ItemNormalizerTest.php +++ b/tests/JsonLd/Serializer/ItemNormalizerTest.php @@ -90,12 +90,15 @@ public function testNormalize(): void ); $normalizer->setSerializer($serializerProphecy->reveal()); - $expected = [ - '@context' => '/contexts/Dummy', - '@id' => '/dummies/1988', - '@type' => 'Dummy', - 'name' => 'hello', - ]; - $this->assertEquals($expected, $normalizer->normalize($dummy)); + $result = $normalizer->normalize($dummy); + + $this->assertEquals('/contexts/Dummy', $result['@context']); + $this->assertEquals('/dummies/1988', $result['@id']); + $this->assertEquals('Dummy', $result['@type']); + $this->assertEquals('hello', $result['name']); + + $this->assertArrayHasKey('operation', $result); + $this->assertIsArray($result['operation']); + $this->assertCount(1, $result['operation']); } } diff --git a/tests/Symfony/Bundle/Test/ApiTestCaseTest.php b/tests/Symfony/Bundle/Test/ApiTestCaseTest.php index 422d1e558c..d1c9782e6e 100644 --- a/tests/Symfony/Bundle/Test/ApiTestCaseTest.php +++ b/tests/Symfony/Bundle/Test/ApiTestCaseTest.php @@ -365,6 +365,12 @@ public function testGetMercureMessages(): void "readOnly": true, "type": "string" }, + "operation": { + "type": "array", + "items": { + "type": "object" + } + }, "id": { "type": "number" }, From e2fd9a1909a35192eb9d221813f58e3b27db4e37 Mon Sep 17 00:00:00 2001 From: Maxcastel Date: Fri, 3 Apr 2026 16:31:20 +0200 Subject: [PATCH 4/9] fix: mercure --- tests/Behat/CommandContext.php | 9 ++++++++- tests/Behat/MercureContext.php | 5 ++++- .../app/config/config_behat_mercure.yml | 18 ++++++++++++++++++ .../app/config/config_behat_mongodb.yml | 3 ++- tests/Fixtures/app/config/config_behat_orm.yml | 3 ++- 5 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 tests/Fixtures/app/config/config_behat_mercure.yml diff --git a/tests/Behat/CommandContext.php b/tests/Behat/CommandContext.php index 666f387410..ad32c3292d 100644 --- a/tests/Behat/CommandContext.php +++ b/tests/Behat/CommandContext.php @@ -18,6 +18,7 @@ use Behat\Gherkin\Node\TableNode; use GraphQL\Error\Error; use PHPUnit\Framework\Assert; +use Psr\Container\ContainerInterface; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Tester\CommandTester; @@ -34,7 +35,9 @@ final class CommandContext implements Context private ?CommandTester $commandTester = null; - public function __construct(private KernelInterface $kernel) + private ?KernelInterface $kernel = null; + + public function __construct(private readonly ContainerInterface $driverContainer) { } @@ -92,6 +95,10 @@ public function getApplication(): Application return $this->application; } + if (null === $this->kernel) { + $this->kernel = $this->driverContainer->get('kernel'); + } + $this->application = new Application($this->kernel); return $this->application; diff --git a/tests/Behat/MercureContext.php b/tests/Behat/MercureContext.php index 2dbd68f877..868d5d0ccd 100644 --- a/tests/Behat/MercureContext.php +++ b/tests/Behat/MercureContext.php @@ -103,7 +103,10 @@ public function mercureUpdateShouldHaveData(int $index, PyStringNode $data): voi } /** @var Update $update */ $update = $updates[$index - 1]; - Assert::assertJsonStringEqualsJsonString($data->getRaw(), $update->getData()); + + $expectedData = json_decode($data->getRaw(), true, 512, \JSON_THROW_ON_ERROR); + $actualData = json_decode($update->getData(), true, 512, \JSON_THROW_ON_ERROR); + Assert::assertEquals($expectedData, $actualData); } /** diff --git a/tests/Fixtures/app/config/config_behat_mercure.yml b/tests/Fixtures/app/config/config_behat_mercure.yml new file mode 100644 index 0000000000..447d3026b3 --- /dev/null +++ b/tests/Fixtures/app/config/config_behat_mercure.yml @@ -0,0 +1,18 @@ +services: + _defaults: + autowire: true + autoconfigure: true + + ApiPlatform\Tests\Behat\CommandContext: + $driverContainer: '@behat.driver.service_container' + ApiPlatform\Tests\Behat\DoctrineContext: + $doctrine: '@doctrine' + ApiPlatform\Tests\Behat\HttpCacheContext: ~ + ApiPlatform\Tests\Behat\HydraContext: ~ + ApiPlatform\Tests\Behat\JsonApiContext: + $doctrine: '@doctrine' + $jsonApiSchemaFile: '%kernel.project_dir%/../JsonSchema/jsonapi.json' + ApiPlatform\Tests\Behat\JsonHalContext: + $schemaFile: '%kernel.project_dir%/../JsonHal/jsonhal.json' + ApiPlatform\Tests\Behat\MercureContext: + $driverContainer: '@behat.driver.service_container' diff --git a/tests/Fixtures/app/config/config_behat_mongodb.yml b/tests/Fixtures/app/config/config_behat_mongodb.yml index d5974d086c..c21f9a16ad 100644 --- a/tests/Fixtures/app/config/config_behat_mongodb.yml +++ b/tests/Fixtures/app/config/config_behat_mongodb.yml @@ -3,7 +3,8 @@ services: autowire: true autoconfigure: true - ApiPlatform\Tests\Behat\CommandContext: ~ + ApiPlatform\Tests\Behat\CommandContext: + $driverContainer: '@behat.driver.service_container' ApiPlatform\Tests\Behat\DoctrineContext: $doctrine: '@doctrine_mongodb' ApiPlatform\Tests\Behat\HttpCacheContext: ~ diff --git a/tests/Fixtures/app/config/config_behat_orm.yml b/tests/Fixtures/app/config/config_behat_orm.yml index da76d75622..d677c871e1 100644 --- a/tests/Fixtures/app/config/config_behat_orm.yml +++ b/tests/Fixtures/app/config/config_behat_orm.yml @@ -4,7 +4,8 @@ services: autowire: true autoconfigure: true - ApiPlatform\Tests\Behat\CommandContext: ~ + ApiPlatform\Tests\Behat\CommandContext: + $driverContainer: '@behat.driver.service_container' ApiPlatform\Tests\Behat\DoctrineContext: $doctrine: '@doctrine' ApiPlatform\Tests\Behat\HttpCacheContext: ~ From cfad5d4b97da9fc391f561e5fa123ebafd93def2 Mon Sep 17 00:00:00 2001 From: Maxcastel Date: Fri, 3 Apr 2026 16:31:53 +0200 Subject: [PATCH 5/9] fix: fix Behat --- features/doctrine/boolean_filter.feature | 1 + features/doctrine/date_filter.feature | 1 + features/doctrine/exists_filter.feature | 1 + .../standard_put_entity_inheritence.feature | 23 + features/doctrine/numeric_filter.feature | 1 + features/doctrine/order_filter.feature | 3 + features/doctrine/range_filter.feature | 1 + features/elasticsearch/read.feature | 66 +++ .../http_cache/tag_collector_service.feature | 46 ++ features/hydra/error.feature | 42 ++ features/hydra/item_uri_template.feature | 2 + features/json/relation.feature | 303 ++++++++++- features/jsonld/absolute_url.feature | 84 ++- .../jsonld/getter_setter_renaming.feature | 38 ++ features/jsonld/input_output.feature | 123 ++++- features/jsonld/interface_as_resource.feature | 76 +++ features/jsonld/json_serializable.feature | 76 +++ features/jsonld/network_path.feature | 84 ++- features/main/attribute_resource.feature | 99 ++++ features/main/circular_reference.feature | 114 ++++ features/main/composite.feature | 100 ++++ features/main/configurable.feature | 38 ++ features/main/crud.feature | 217 ++++++++ features/main/crud_abstract.feature | 250 +++++++++ features/main/crud_uri_variables.feature | 48 +- features/main/custom_controller.feature | 246 ++++++++- features/main/custom_identifier.feature | 188 +++++++ ...custom_identifier_with_subresource.feature | 114 ++++ features/main/custom_normalized.feature | 152 ++++++ features/main/custom_put.feature | 23 + .../main/custom_writable_identifier.feature | 126 +++++ features/main/exposed_state.feature | 108 +++- features/main/operation.feature | 54 ++ features/main/operation_resource.feature | 98 ++++ features/main/overridden_operation.feature | 96 ++++ features/main/patch.feature | 46 ++ features/main/relation.feature | 514 +++++++++++++++++- .../serializable_item_data_provider.feature | 38 ++ features/main/standard_put.feature | 89 ++- features/main/sub_resource.feature | 280 +++++++++- features/main/table_inheritance.feature | 1 + features/main/url_encoded_id.feature | 9 + features/main/uuid.feature | 114 ++++ features/mercure/publish.feature | 26 + features/security/strong_typing.feature | 38 ++ features/security/unknown_attributes.feature | 38 ++ .../serializer/empty_array_as_object.feature | 9 + features/serializer/group_filter.feature | 392 ++++++++++++- features/serializer/property_filter.feature | 83 ++- features/serializer/vo_relations.feature | 176 +++++- .../sub_resources/multiple_relation.feature | 12 + 51 files changed, 4854 insertions(+), 53 deletions(-) diff --git a/features/doctrine/boolean_filter.feature b/features/doctrine/boolean_filter.feature index e3332eea7b..b6b9ce19d6 100644 --- a/features/doctrine/boolean_filter.feature +++ b/features/doctrine/boolean_filter.feature @@ -471,6 +471,7 @@ Feature: Boolean filter on collections "properties": { "@id": {"pattern": "^/converted_booleans/(2|4)$"}, "@type": {"pattern": "^ConvertedBoolean"}, + "operation": {"type": "array"}, "name_converted": {"type": "boolean"}, "id": {"type": "integer", "minimum":2, "maximum": 4} }, diff --git a/features/doctrine/date_filter.feature b/features/doctrine/date_filter.feature index 7d8d1a906f..0247bb45e2 100644 --- a/features/doctrine/date_filter.feature +++ b/features/doctrine/date_filter.feature @@ -582,6 +582,7 @@ Feature: Date filter on collections "properties": { "@id": {"pattern": "^/converted_dates/(29|30)$"}, "@type": {"pattern": "^ConvertedDate"}, + "operation": {"type": "array"}, "name_converted": {"type": "string"}, "id": {"type": "integer", "minimum":29, "maximum": 30} }, diff --git a/features/doctrine/exists_filter.feature b/features/doctrine/exists_filter.feature index e99f2ff445..73295c0daa 100644 --- a/features/doctrine/exists_filter.feature +++ b/features/doctrine/exists_filter.feature @@ -169,6 +169,7 @@ Feature: Exists filter on collections "properties": { "@id": {"pattern": "^/converted_strings/(1|3)$"}, "@type": {"pattern": "^ConvertedString"}, + "operation": {"type": "array"}, "name_converted": {"pattern": "^name#(1|3)$"}, "id": {"type": "integer", "minimum":1, "maximum": 3} }, diff --git a/features/doctrine/issue6175/standard_put_entity_inheritence.feature b/features/doctrine/issue6175/standard_put_entity_inheritence.feature index 07d0d7e88c..70341e4fae 100644 --- a/features/doctrine/issue6175/standard_put_entity_inheritence.feature +++ b/features/doctrine/issue6175/standard_put_entity_inheritence.feature @@ -19,6 +19,29 @@ Feature: Update properties of a resource that are inherited with standard PUT op "@context": "/contexts/DummyMappedSubclass", "@id": "/dummy_mapped_subclasses/1", "@type": "DummyMappedSubclass", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a DummyMappedSubclass resource.", + "hydra:method": "GET", + "hydra:title": "getDummyMappedSubclass", + "returns": "owl:Nothing" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "DummyMappedSubclass", + "hydra:description": "Replaces the DummyMappedSubclass resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyMappedSubclass", + "returns": "DummyMappedSubclass" + } + ], "id": 1, "foo": "updated value" } diff --git a/features/doctrine/numeric_filter.feature b/features/doctrine/numeric_filter.feature index ec449ae0be..adaa0c549b 100644 --- a/features/doctrine/numeric_filter.feature +++ b/features/doctrine/numeric_filter.feature @@ -159,6 +159,7 @@ Feature: Numeric filter on collections "properties": { "@id": {"pattern": "^/converted_integers/(2|3)$"}, "@type": {"pattern": "^ConvertedInteger$"}, + "operation": {"type": "array"}, "name_converted": {"type": "integer"}, "id": {"type": "integer", "minimum":2, "maximum": 3} }, diff --git a/features/doctrine/order_filter.feature b/features/doctrine/order_filter.feature index 4d3d5587b9..729900ec9e 100644 --- a/features/doctrine/order_filter.feature +++ b/features/doctrine/order_filter.feature @@ -733,6 +733,7 @@ Feature: Order filter on collections "properties": { "@id": {"pattern": "^/converted_integers/3$"}, "@type": {"pattern": "^ConvertedInteger$"}, + "operation": {"type": "array"}, "name_converted": {"type": "integer"}, "id": {"type": "integer", "minimum":3, "maximum": 3} }, @@ -744,6 +745,7 @@ Feature: Order filter on collections "properties": { "@id": {"pattern": "^/converted_integers/2$"}, "@type": {"pattern": "^ConvertedInteger$"}, + "operation": {"type": "array"}, "name_converted": {"type": "integer"}, "id": {"type": "integer", "minimum":2, "maximum": 2} }, @@ -755,6 +757,7 @@ Feature: Order filter on collections "properties": { "@id": {"pattern": "^/converted_integers/1$"}, "@type": {"pattern": "^ConvertedInteger$"}, + "operation": {"type": "array"}, "name_converted": {"type": "integer"}, "id": {"type": "integer", "minimum":1, "maximum": 1} }, diff --git a/features/doctrine/range_filter.feature b/features/doctrine/range_filter.feature index 9a9ec12d07..263ea26c56 100644 --- a/features/doctrine/range_filter.feature +++ b/features/doctrine/range_filter.feature @@ -447,6 +447,7 @@ Feature: Range filter on collections "properties": { "@id": {"pattern": "^/converted_integers/(1|2)$"}, "@type": {"pattern": "^ConvertedInteger$"}, + "operation": {"type": "array"}, "name_converted": {"type": "integer"}, "id": {"type": "integer", "minimum":1, "maximum": 2} }, diff --git a/features/elasticsearch/read.feature b/features/elasticsearch/read.feature index 226acafaf6..7308a3a37c 100644 --- a/features/elasticsearch/read.feature +++ b/features/elasticsearch/read.feature @@ -15,6 +15,39 @@ Feature: Retrieve from Elasticsearch "@context": "/contexts/User", "@id": "/users/116b83f8-6c32-48d8-8e28-c5c247532d3f", "@type": "User", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a User resource.", + "hydra:method": "GET", + "hydra:title": "getUser", + "returns": "User" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "User", + "hydra:description": "Replaces the User resource.", + "hydra:method": "PUT", + "hydra:title": "putUser", + "returns": "User" + }, + { + "@type": "hydra:Operation", + "expects": "User", + "expectsHeader": [{"headerName": "Content-Type", "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"]}], + "hydra:description": "Updates the User resource.", + "hydra:method": "PATCH", + "hydra:title": "patchUser", + "returns": "User" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the User resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteUser", + "returns": "owl:Nothing" + } + ], "id": "116b83f8-6c32-48d8-8e28-c5c247532d3f", "gender": "male", "age": 31, @@ -392,6 +425,39 @@ Feature: Retrieve from Elasticsearch "@context": "/contexts/Library", "@id": "/libraries/116b83f8-6c32-48d8-8e28-c5c247532d3f", "@type": "Library", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Library resource.", + "hydra:method": "GET", + "hydra:title": "getLibrary", + "returns": "Library" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Library", + "hydra:description": "Replaces the Library resource.", + "hydra:method": "PUT", + "hydra:title": "putLibrary", + "returns": "Library" + }, + { + "@type": "hydra:Operation", + "expects": "Library", + "expectsHeader": [{"headerName": "Content-Type", "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"]}], + "hydra:description": "Updates the Library resource.", + "hydra:method": "PATCH", + "hydra:title": "patchLibrary", + "returns": "Library" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Library resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteLibrary", + "returns": "owl:Nothing" + } + ], "id": "116b83f8-6c32-48d8-8e28-c5c247532d3f", "gender": "male", "age": 31, diff --git a/features/http_cache/tag_collector_service.feature b/features/http_cache/tag_collector_service.feature index ed994aadb7..7b5dbcc53d 100644 --- a/features/http_cache/tag_collector_service.feature +++ b/features/http_cache/tag_collector_service.feature @@ -46,6 +46,52 @@ Feature: Cache invalidation through HTTP Cache tags (custom TagCollector service "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/2", "@type": "RelationEmbedder", + "operation": [ + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Deletes the RelationEmbedder resource.", + "hydra:method": "DELETE", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + } + ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/1", diff --git a/features/hydra/error.feature b/features/hydra/error.feature index 07fe8210f0..acf29793b7 100644 --- a/features/hydra/error.feature +++ b/features/hydra/error.feature @@ -40,6 +40,48 @@ Feature: Error handling "@context": "/contexts/ConstraintViolation", "@id": "/validation_errors/c1051bb4-d103-4f74-8988-acbcafc7fdc3", "@type": "ConstraintViolation", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a ConstraintViolation resource.", + "hydra:method": "GET", + "hydra:title": "getConstraintViolation", + "returns": "ConstraintViolation" + }, + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a ConstraintViolation resource.", + "hydra:method": "GET", + "hydra:title": "getConstraintViolation", + "returns": "ConstraintViolation" + }, + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a ConstraintViolation resource.", + "hydra:method": "GET", + "hydra:title": "getConstraintViolation", + "returns": "ConstraintViolation" + }, + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a ConstraintViolation resource.", + "hydra:method": "GET", + "hydra:title": "getConstraintViolation", + "returns": "ConstraintViolation" + } + ], "status": 422, "violations": [ { diff --git a/features/hydra/item_uri_template.feature b/features/hydra/item_uri_template.feature index 0c73283235..14b2b693fd 100644 --- a/features/hydra/item_uri_template.feature +++ b/features/hydra/item_uri_template.feature @@ -99,6 +99,7 @@ Feature: Exposing a collection of objects should use the specified operation to "@context": {"pattern": "^/contexts/Car$"}, "@id": {"pattern": "^/cars/.+$"}, "@type": {"pattern": "^Car$"}, + "operation": {"type": "array"}, "id": {"type": "string"}, "owner": {"type": "string"} } @@ -126,6 +127,7 @@ Feature: Exposing a collection of objects should use the specified operation to "@context": {"pattern": "^/contexts/Car$"}, "@id": {"pattern": "^/brands/renault/cars/.+$"}, "@type": {"pattern": "^Car$"}, + "operation": {"type": "array"}, "id": {"type": "string"}, "owner": {"type": "string"} } diff --git a/features/json/relation.feature b/features/json/relation.feature index 3455d9d412..3236de41f3 100644 --- a/features/json/relation.feature +++ b/features/json/relation.feature @@ -21,6 +21,39 @@ Feature: JSON relations support "@context": "/contexts/ThirdLevel", "@id": "/third_levels/1", "@type": "ThirdLevel", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a ThirdLevel resource.", + "hydra:method": "GET", + "hydra:title": "getThirdLevel", + "returns": "ThirdLevel" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "ThirdLevel", + "hydra:description": "Replaces the ThirdLevel resource.", + "hydra:method": "PUT", + "hydra:title": "putThirdLevel", + "returns": "ThirdLevel" + }, + { + "@type": "hydra:Operation", + "expects": "ThirdLevel", + "expectsHeader": [{"headerName": "Content-Type", "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"]}], + "hydra:description": "Updates the ThirdLevel resource.", + "hydra:method": "PATCH", + "hydra:title": "patchThirdLevel", + "returns": "ThirdLevel" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the ThirdLevel resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteThirdLevel", + "returns": "owl:Nothing" + } + ], "fourthLevel": null, "badFourthLevel": null, "id": 1, @@ -49,6 +82,52 @@ Feature: JSON relations support "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/1", "@type": "RelationEmbedder", + "operation": [ + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Deletes the RelationEmbedder resource.", + "hydra:method": "DELETE", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + } + ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/1", @@ -79,6 +158,52 @@ Feature: JSON relations support "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/1", "@type": "RelationEmbedder", + "operation": [ + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Deletes the RelationEmbedder resource.", + "hydra:method": "DELETE", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + } + ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/2", @@ -110,6 +235,52 @@ Feature: JSON relations support "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/1", "@type": "RelationEmbedder", + "operation": [ + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Deletes the RelationEmbedder resource.", + "hydra:method": "DELETE", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + } + ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/1", @@ -141,6 +312,52 @@ Feature: JSON relations support "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/1", "@type": "RelationEmbedder", + "operation": [ + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Deletes the RelationEmbedder resource.", + "hydra:method": "DELETE", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + } + ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/1", @@ -169,6 +386,44 @@ Feature: JSON relations support "@context": "/contexts/RelatedDummy", "@id": "/related_dummies/3", "@type": "https://schema.org/Product", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a RelatedDummy resource.", + "hydra:method": "GET", + "hydra:title": "getRelatedDummy", + "returns": "RelatedDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "RelatedDummy", + "hydra:description": "Replaces the RelatedDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putRelatedDummy", + "returns": "RelatedDummy" + }, + { + "@type": "hydra:Operation", + "expects": "RelatedDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the RelatedDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchRelatedDummy", + "returns": "RelatedDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the RelatedDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteRelatedDummy", + "returns": "owl:Nothing" + } + ], "id": 3, "name": null, "symfony": "symfony", @@ -206,6 +461,48 @@ Feature: JSON relations support "@context": "/contexts/Dummy", "@id": "/dummies/1", "@type": "Dummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Dummy resource.", + "hydra:method": "GET", + "hydra:title": "getDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Dummy", + "hydra:description": "Replaces the Dummy resource.", + "hydra:method": "PUT", + "hydra:title": "putDummy", + "returns": "Dummy" + }, + { + "@type": "hydra:Operation", + "expects": "Dummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Dummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Dummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummy", + "returns": "owl:Nothing" + } + ], + "id": 1, + "name": "Dummy with plain relations", + "alias": null, + "foo": null, "description": null, "dummy": null, "dummyBoolean": null, @@ -220,10 +517,6 @@ Feature: JSON relations support "arrayData": [], "name_converted": null, "relatedOwnedDummy": null, - "relatedOwningDummy": null, - "id": 1, - "name": "Dummy with plain relations", - "alias": null, - "foo": null + "relatedOwningDummy": null } """ diff --git a/features/jsonld/absolute_url.feature b/features/jsonld/absolute_url.feature index 9770e6bbb7..49478c052d 100644 --- a/features/jsonld/absolute_url.feature +++ b/features/jsonld/absolute_url.feature @@ -42,8 +42,46 @@ Feature: IRI should contain Absolute URL "@context": "http://example.com/contexts/AbsoluteUrlRelationDummy", "@id": "http://example.com/absolute_url_relation_dummies/2", "@type": "AbsoluteUrlRelationDummy", - "absoluteUrlDummies": [], - "id": 2 + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a AbsoluteUrlRelationDummy resource.", + "hydra:method": "GET", + "hydra:title": "getAbsoluteUrlRelationDummy", + "returns": "AbsoluteUrlRelationDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "AbsoluteUrlRelationDummy", + "hydra:description": "Replaces the AbsoluteUrlRelationDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putAbsoluteUrlRelationDummy", + "returns": "AbsoluteUrlRelationDummy" + }, + { + "@type": "hydra:Operation", + "expects": "AbsoluteUrlRelationDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the AbsoluteUrlRelationDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchAbsoluteUrlRelationDummy", + "returns": "AbsoluteUrlRelationDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the AbsoluteUrlRelationDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteAbsoluteUrlRelationDummy", + "returns": "owl:Nothing" + } + ], + "id": 2, + "absoluteUrlDummies": [] } """ @@ -56,8 +94,46 @@ Feature: IRI should contain Absolute URL "@context": "http://example.com/contexts/AbsoluteUrlDummy", "@id": "http://example.com/absolute_url_dummies/1", "@type": "AbsoluteUrlDummy", - "absoluteUrlRelationDummy": "http://example.com/absolute_url_relation_dummies/1", - "id": 1 + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a AbsoluteUrlDummy resource.", + "hydra:method": "GET", + "hydra:title": "getAbsoluteUrlDummy", + "returns": "AbsoluteUrlDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "AbsoluteUrlDummy", + "hydra:description": "Replaces the AbsoluteUrlDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putAbsoluteUrlDummy", + "returns": "AbsoluteUrlDummy" + }, + { + "@type": "hydra:Operation", + "expects": "AbsoluteUrlDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the AbsoluteUrlDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchAbsoluteUrlDummy", + "returns": "AbsoluteUrlDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the AbsoluteUrlDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteAbsoluteUrlDummy", + "returns": "owl:Nothing" + } + ], + "id": 1, + "absoluteUrlRelationDummy": "http://example.com/absolute_url_relation_dummies/1" } """ diff --git a/features/jsonld/getter_setter_renaming.feature b/features/jsonld/getter_setter_renaming.feature index d5f876918b..3c52d43a5c 100644 --- a/features/jsonld/getter_setter_renaming.feature +++ b/features/jsonld/getter_setter_renaming.feature @@ -20,6 +20,44 @@ Feature: Resource should contain one field for each property "@context": "/contexts/EntityWithRenamedGetterAndSetter", "@id": "/entity_with_renamed_getter_and_setters", "@type": "EntityWithRenamedGetterAndSetter", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a EntityWithRenamedGetterAndSetter resource.", + "hydra:method": "GET", + "hydra:title": "getEntityWithRenamedGetterAndSetter", + "returns": "EntityWithRenamedGetterAndSetter" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "EntityWithRenamedGetterAndSetter", + "hydra:description": "Replaces the EntityWithRenamedGetterAndSetter resource.", + "hydra:method": "PUT", + "hydra:title": "putEntityWithRenamedGetterAndSetter", + "returns": "EntityWithRenamedGetterAndSetter" + }, + { + "@type": "hydra:Operation", + "expects": "EntityWithRenamedGetterAndSetter", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the EntityWithRenamedGetterAndSetter resource.", + "hydra:method": "PATCH", + "hydra:title": "patchEntityWithRenamedGetterAndSetter", + "returns": "EntityWithRenamedGetterAndSetter" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the EntityWithRenamedGetterAndSetter resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteEntityWithRenamedGetterAndSetter", + "returns": "owl:Nothing" + } + ], "firstnameOnly": "Sarah" } """ diff --git a/features/jsonld/input_output.feature b/features/jsonld/input_output.feature index 121f305006..cc641ca3ab 100644 --- a/features/jsonld/input_output.feature +++ b/features/jsonld/input_output.feature @@ -25,9 +25,40 @@ Feature: JSON-LD DTO input and output "@context": "/contexts/DummyDtoCustom", "@id": "/dummy_dto_customs/1", "@type": "DummyDtoCustom", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a DummyDtoCustom resource.", + "hydra:method": "GET", + "hydra:title": "getDummyDtoCustom", + "returns": "DummyDtoCustom" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "DummyDtoCustom", + "hydra:description": "Replaces the DummyDtoCustom resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyDtoCustom", + "returns": "DummyDtoCustom" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the DummyDtoCustom resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyDtoCustom", + "returns": "owl:Nothing" + }, + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a DummyDtoCustom resource.", + "hydra:method": "GET", + "hydra:title": "getDummyDtoCustom", + "returns": "DummyDtoCustom" + } + ], + "id": 1, "lorem": "test", - "ipsum": "1", - "id": 1 + "ipsum": "1" } """ @@ -253,6 +284,56 @@ Feature: JSON-LD DTO input and output "@context": "/contexts/MessengerWithInput", "@id": "/messenger_with_inputs/1", "@type": "MessengerWithInput", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a MessengerWithInput resource.", + "hydra:method": "GET", + "hydra:title": "getMessengerWithInput", + "returns": "MessengerWithInput" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "MessengerWithInput", + "hydra:description": "Replaces the MessengerWithInput resource.", + "hydra:method": "PUT", + "hydra:title": "putMessengerWithInput", + "returns": "MessengerWithInput" + }, + { + "@type": "hydra:Operation", + "expects": "MessengerWithInput", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the MessengerWithInput resource.", + "hydra:method": "PATCH", + "hydra:title": "patchMessengerWithInput", + "returns": "MessengerWithInput" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the MessengerWithInput resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteMessengerWithInput", + "returns": "owl:Nothing" + } + ], "id": 1, "name": "test" } @@ -293,6 +374,44 @@ Feature: JSON-LD DTO input and output "@context": "/contexts/InitializeInput", "@id": "/initialize_inputs/1", "@type": "InitializeInput", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a InitializeInput resource.", + "hydra:method": "GET", + "hydra:title": "getInitializeInput", + "returns": "InitializeInput" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "InitializeInput", + "hydra:description": "Replaces the InitializeInput resource.", + "hydra:method": "PUT", + "hydra:title": "putInitializeInput", + "returns": "InitializeInput" + }, + { + "@type": "hydra:Operation", + "expects": "InitializeInput", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the InitializeInput resource.", + "hydra:method": "PATCH", + "hydra:title": "patchInitializeInput", + "returns": "InitializeInput" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the InitializeInput resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteInitializeInput", + "returns": "owl:Nothing" + } + ], "id": 1, "manager": "Orwell", "name": "La peste" diff --git a/features/jsonld/interface_as_resource.feature b/features/jsonld/interface_as_resource.feature index 7236ace7ae..275a751787 100644 --- a/features/jsonld/interface_as_resource.feature +++ b/features/jsonld/interface_as_resource.feature @@ -25,6 +25,44 @@ Feature: JSON-LD using interface as resource "@context": "/contexts/Taxon", "@id": "/taxa/WONDERFUL_TAXON", "@type": "Taxon", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Taxon resource.", + "hydra:method": "GET", + "hydra:title": "getTaxon", + "returns": "Taxon" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Taxon", + "hydra:description": "Replaces the Taxon resource.", + "hydra:method": "PUT", + "hydra:title": "putTaxon", + "returns": "Taxon" + }, + { + "@type": "hydra:Operation", + "expects": "Taxon", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Taxon resource.", + "hydra:method": "PATCH", + "hydra:title": "patchTaxon", + "returns": "Taxon" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Taxon resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteTaxon", + "returns": "owl:Nothing" + } + ], "code": "WONDERFUL_TAXON" } """ @@ -47,6 +85,44 @@ Feature: JSON-LD using interface as resource "@context": "/contexts/Product", "@id": "/products/GREAT_PRODUCT", "@type": "Product", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Product resource.", + "hydra:method": "GET", + "hydra:title": "getProduct", + "returns": "Product" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Product", + "hydra:description": "Replaces the Product resource.", + "hydra:method": "PUT", + "hydra:title": "putProduct", + "returns": "Product" + }, + { + "@type": "hydra:Operation", + "expects": "Product", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Product resource.", + "hydra:method": "PATCH", + "hydra:title": "patchProduct", + "returns": "Product" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Product resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteProduct", + "returns": "owl:Nothing" + } + ], "code": "GREAT_PRODUCT", "mainTaxon": { "@id": "/taxa/WONDERFUL_TAXON", diff --git a/features/jsonld/json_serializable.feature b/features/jsonld/json_serializable.feature index 57cb57de51..53e09ef34d 100644 --- a/features/jsonld/json_serializable.feature +++ b/features/jsonld/json_serializable.feature @@ -34,6 +34,44 @@ Feature: JSON-LD using JsonSerializable types "@context": "/contexts/Content", "@id": "/contents/1", "@type": "Content", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Content resource.", + "hydra:method": "GET", + "hydra:title": "getContent", + "returns": "Content" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Content", + "hydra:description": "Replaces the Content resource.", + "hydra:method": "PUT", + "hydra:title": "putContent", + "returns": "Content" + }, + { + "@type": "hydra:Operation", + "expects": "Content", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Content resource.", + "hydra:method": "PATCH", + "hydra:title": "patchContent", + "returns": "Content" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Content resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteContent", + "returns": "owl:Nothing" + } + ], "id": 1, "contentType": "homepage", "status": { @@ -58,6 +96,44 @@ Feature: JSON-LD using JsonSerializable types "@context": "/contexts/Content", "@id": "/contents/1", "@type": "Content", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Content resource.", + "hydra:method": "GET", + "hydra:title": "getContent", + "returns": "Content" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Content", + "hydra:description": "Replaces the Content resource.", + "hydra:method": "PUT", + "hydra:title": "putContent", + "returns": "Content" + }, + { + "@type": "hydra:Operation", + "expects": "Content", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Content resource.", + "hydra:method": "PATCH", + "hydra:title": "patchContent", + "returns": "Content" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Content resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteContent", + "returns": "owl:Nothing" + } + ], "id": 1, "contentType": "homepage", "status": { diff --git a/features/jsonld/network_path.feature b/features/jsonld/network_path.feature index 6d486390e3..3fd51f565f 100644 --- a/features/jsonld/network_path.feature +++ b/features/jsonld/network_path.feature @@ -43,8 +43,46 @@ Feature: IRI should contain network path "@context": "//example.com/contexts/NetworkPathRelationDummy", "@id": "//example.com/network_path_relation_dummies/2", "@type": "NetworkPathRelationDummy", - "networkPathDummies": [], - "id": 2 + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a NetworkPathRelationDummy resource.", + "hydra:method": "GET", + "hydra:title": "getNetworkPathRelationDummy", + "returns": "NetworkPathRelationDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "NetworkPathRelationDummy", + "hydra:description": "Replaces the NetworkPathRelationDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putNetworkPathRelationDummy", + "returns": "NetworkPathRelationDummy" + }, + { + "@type": "hydra:Operation", + "expects": "NetworkPathRelationDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the NetworkPathRelationDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchNetworkPathRelationDummy", + "returns": "NetworkPathRelationDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the NetworkPathRelationDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteNetworkPathRelationDummy", + "returns": "owl:Nothing" + } + ], + "id": 2, + "networkPathDummies": [] } """ @@ -58,8 +96,46 @@ Feature: IRI should contain network path "@context": "//example.com/contexts/NetworkPathDummy", "@id": "//example.com/network_path_dummies/1", "@type": "NetworkPathDummy", - "networkPathRelationDummy": "//example.com/network_path_relation_dummies/1", - "id": 1 + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a NetworkPathDummy resource.", + "hydra:method": "GET", + "hydra:title": "getNetworkPathDummy", + "returns": "NetworkPathDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "NetworkPathDummy", + "hydra:description": "Replaces the NetworkPathDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putNetworkPathDummy", + "returns": "NetworkPathDummy" + }, + { + "@type": "hydra:Operation", + "expects": "NetworkPathDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the NetworkPathDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchNetworkPathDummy", + "returns": "NetworkPathDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the NetworkPathDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteNetworkPathDummy", + "returns": "owl:Nothing" + } + ], + "id": 1, + "networkPathRelationDummy": "//example.com/network_path_relation_dummies/1" } """ diff --git a/features/main/attribute_resource.feature b/features/main/attribute_resource.feature index da92073e98..abc5949df8 100644 --- a/features/main/attribute_resource.feature +++ b/features/main/attribute_resource.feature @@ -48,6 +48,39 @@ Feature: Resource attributes "@context": "/contexts/AttributeResource", "@id": "/attribute_resources/1", "@type": "AttributeResource", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a AttributeResource resource.", + "hydra:method": "GET", + "hydra:title": "getAttributeResource", + "returns": "AttributeResource" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "AttributeResource", + "hydra:description": "Replaces the AttributeResource resource.", + "hydra:method": "PUT", + "hydra:title": "putAttributeResource", + "returns": "AttributeResource" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the AttributeResource resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteAttributeResource", + "returns": "owl:Nothing" + } + ], "identifier": 1, "name": "Foo" } @@ -66,6 +99,39 @@ Feature: Resource attributes "@context": "/contexts/AttributeResource", "@id": "/attribute_resources/2", "@type": "AttributeResource", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a AttributeResource resource.", + "hydra:method": "GET", + "hydra:title": "getAttributeResource", + "returns": "AttributeResource" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "AttributeResource", + "hydra:description": "Replaces the AttributeResource resource.", + "hydra:method": "PUT", + "hydra:title": "putAttributeResource", + "returns": "AttributeResource" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the AttributeResource resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteAttributeResource", + "returns": "owl:Nothing" + } + ], "identifier": 2, "dummy": "/dummies/1", "name": "Foo" @@ -88,6 +154,39 @@ Feature: Resource attributes "@context": "/contexts/AttributeResource", "@id": "/attribute_resources/2", "@type": "AttributeResource", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a AttributeResource resource.", + "hydra:method": "GET", + "hydra:title": "getAttributeResource", + "returns": "AttributeResource" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "AttributeResource", + "hydra:description": "Replaces the AttributeResource resource.", + "hydra:method": "PUT", + "hydra:title": "putAttributeResource", + "returns": "AttributeResource" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the AttributeResource resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteAttributeResource", + "returns": "owl:Nothing" + } + ], "identifier": 2, "dummy": "/dummies/1", "name": "Patched" diff --git a/features/main/circular_reference.feature b/features/main/circular_reference.feature index f53d44d916..41d477bf6a 100644 --- a/features/main/circular_reference.feature +++ b/features/main/circular_reference.feature @@ -26,6 +26,44 @@ Feature: Circular references handling "@context": "/contexts/CircularReference", "@id": "/circular_references/1", "@type": "CircularReference", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a CircularReference resource.", + "hydra:method": "GET", + "hydra:title": "getCircularReference", + "returns": "CircularReference" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "CircularReference", + "hydra:description": "Replaces the CircularReference resource.", + "hydra:method": "PUT", + "hydra:title": "putCircularReference", + "returns": "CircularReference" + }, + { + "@type": "hydra:Operation", + "expects": "CircularReference", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the CircularReference resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCircularReference", + "returns": "CircularReference" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the CircularReference resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCircularReference", + "returns": "owl:Nothing" + } + ], "parent": "/circular_references/1", "children": [ "/circular_references/1" @@ -55,6 +93,44 @@ Feature: Circular references handling "@context": "/contexts/CircularReference", "@id": "/circular_references/2", "@type": "CircularReference", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a CircularReference resource.", + "hydra:method": "GET", + "hydra:title": "getCircularReference", + "returns": "CircularReference" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "CircularReference", + "hydra:description": "Replaces the CircularReference resource.", + "hydra:method": "PUT", + "hydra:title": "putCircularReference", + "returns": "CircularReference" + }, + { + "@type": "hydra:Operation", + "expects": "CircularReference", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the CircularReference resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCircularReference", + "returns": "CircularReference" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the CircularReference resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCircularReference", + "returns": "owl:Nothing" + } + ], "parent": { "@id": "/circular_references/1", "@type": "CircularReference", @@ -75,6 +151,44 @@ Feature: Circular references handling "@context": "/contexts/CircularReference", "@id": "/circular_references/1", "@type": "CircularReference", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a CircularReference resource.", + "hydra:method": "GET", + "hydra:title": "getCircularReference", + "returns": "CircularReference" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "CircularReference", + "hydra:description": "Replaces the CircularReference resource.", + "hydra:method": "PUT", + "hydra:title": "putCircularReference", + "returns": "CircularReference" + }, + { + "@type": "hydra:Operation", + "expects": "CircularReference", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the CircularReference resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCircularReference", + "returns": "CircularReference" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the CircularReference resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCircularReference", + "returns": "owl:Nothing" + } + ], "parent": "/circular_references/1", "children": [ "/circular_references/1", diff --git a/features/main/composite.feature b/features/main/composite.feature index ab99527bd7..ce99918955 100644 --- a/features/main/composite.feature +++ b/features/main/composite.feature @@ -95,6 +95,56 @@ Feature: Retrieve data with Composite identifiers "@context": "/contexts/CompositeRelation", "@id": "/composite_relations/compositeItem=1;compositeLabel=1", "@type": "CompositeRelation", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CompositeRelation resource.", + "hydra:method": "GET", + "hydra:title": "getCompositeRelation", + "returns": "CompositeRelation" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "CompositeRelation", + "hydra:description": "Replaces the CompositeRelation resource.", + "hydra:method": "PUT", + "hydra:title": "putCompositeRelation", + "returns": "CompositeRelation" + }, + { + "@type": "hydra:Operation", + "expects": "CompositeRelation", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the CompositeRelation resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCompositeRelation", + "returns": "CompositeRelation" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the CompositeRelation resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCompositeRelation", + "returns": "owl:Nothing" + } + ], "value": "somefoobardummy", "compositeItem": "/composite_items/1", "compositeLabel": "/composite_labels/1" @@ -114,6 +164,56 @@ Feature: Retrieve data with Composite identifiers "@context": "/contexts/CompositeRelation", "@id": "/composite_relations/compositeItem=1;compositeLabel=1", "@type": "CompositeRelation", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CompositeRelation resource.", + "hydra:method": "GET", + "hydra:title": "getCompositeRelation", + "returns": "CompositeRelation" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "CompositeRelation", + "hydra:description": "Replaces the CompositeRelation resource.", + "hydra:method": "PUT", + "hydra:title": "putCompositeRelation", + "returns": "CompositeRelation" + }, + { + "@type": "hydra:Operation", + "expects": "CompositeRelation", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the CompositeRelation resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCompositeRelation", + "returns": "CompositeRelation" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the CompositeRelation resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCompositeRelation", + "returns": "owl:Nothing" + } + ], "value": "somefoobardummy", "compositeItem": "/composite_items/1", "compositeLabel": "/composite_labels/1" diff --git a/features/main/configurable.feature b/features/main/configurable.feature index c0e73d1ba2..e3f6fc9439 100644 --- a/features/main/configurable.feature +++ b/features/main/configurable.feature @@ -55,6 +55,44 @@ Feature: Configurable resource CRUD "@context": "/contexts/fileconfigdummy", "@id": "/fileconfigdummies/1", "@type": "fileconfigdummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a fileconfigdummy resource.", + "hydra:method": "GET", + "hydra:title": "getfileconfigdummy", + "returns": "fileconfigdummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "fileconfigdummy", + "hydra:description": "Replaces the fileconfigdummy resource.", + "hydra:method": "PUT", + "hydra:title": "putfileconfigdummy", + "returns": "fileconfigdummy" + }, + { + "@type": "hydra:Operation", + "expects": "fileconfigdummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the fileconfigdummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchfileconfigdummy", + "returns": "fileconfigdummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the fileconfigdummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deletefileconfigdummy", + "returns": "owl:Nothing" + } + ], "id": 1, "name": "ConfigDummy", "foo": "Foo" diff --git a/features/main/crud.feature b/features/main/crud.feature index 5933812bcc..6673d6ee25 100644 --- a/features/main/crud.feature +++ b/features/main/crud.feature @@ -30,6 +30,44 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/Dummy", "@id": "/dummies/1", "@type": "Dummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Dummy resource.", + "hydra:method": "GET", + "hydra:title": "getDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Dummy", + "hydra:description": "Replaces the Dummy resource.", + "hydra:method": "PUT", + "hydra:title": "putDummy", + "returns": "Dummy" + }, + { + "@type": "hydra:Operation", + "expects": "Dummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Dummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Dummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummy", + "returns": "owl:Nothing" + } + ], "description": null, "dummy": null, "dummyBoolean": null, @@ -67,6 +105,44 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/Dummy", "@id": "/dummies/1", "@type": "Dummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Dummy resource.", + "hydra:method": "GET", + "hydra:title": "getDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Dummy", + "hydra:description": "Replaces the Dummy resource.", + "hydra:method": "PUT", + "hydra:title": "putDummy", + "returns": "Dummy" + }, + { + "@type": "hydra:Operation", + "expects": "Dummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Dummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Dummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummy", + "returns": "owl:Nothing" + } + ], "description": null, "dummy": null, "dummyBoolean": null, @@ -523,6 +599,44 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/Dummy", "@id": "/dummies/1", "@type": "Dummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Dummy resource.", + "hydra:method": "GET", + "hydra:title": "getDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Dummy", + "hydra:description": "Replaces the Dummy resource.", + "hydra:method": "PUT", + "hydra:title": "putDummy", + "returns": "Dummy" + }, + { + "@type": "hydra:Operation", + "expects": "Dummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Dummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Dummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummy", + "returns": "owl:Nothing" + } + ], "description": null, "dummy": null, "dummyBoolean": null, @@ -582,6 +696,15 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/ProcessorEntity", "@id": "/processor_entities/1", "@type": "ProcessorEntity", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a ProcessorEntity resource.", + "hydra:method": "GET", + "hydra:title": "getProcessorEntity", + "returns": "ProcessorEntity" + } + ], "id": 1, "foo": "bar" } @@ -607,6 +730,15 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/ProviderEntity", "@id": "/provider_entities/1", "@type": "ProviderEntity", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a ProviderEntity resource.", + "hydra:method": "GET", + "hydra:title": "getProviderEntity", + "returns": "ProviderEntity" + } + ], "id": 1, "foo": "bar" } @@ -650,6 +782,15 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/ProviderEntity", "@id": "/provider_entities/1", "@type": "ProviderEntity", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a ProviderEntity resource.", + "hydra:method": "GET", + "hydra:title": "getProviderEntity", + "returns": "ProviderEntity" + } + ], "id": 1, "foo": "bar" } @@ -668,6 +809,44 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/Program", "@id": "/programs/1", "@type": "Program", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Program resource.", + "hydra:method": "GET", + "hydra:title": "getProgram", + "returns": "Program" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Program", + "hydra:description": "Replaces the Program resource.", + "hydra:method": "PUT", + "hydra:title": "putProgram", + "returns": "Program" + }, + { + "@type": "hydra:Operation", + "expects": "Program", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Program resource.", + "hydra:method": "PATCH", + "hydra:title": "patchProgram", + "returns": "Program" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Program resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteProgram", + "returns": "owl:Nothing" + } + ], "id": 1, "name": "Lorem ipsum 1", "date": "2015-03-01T10:00:00+00:00", @@ -731,6 +910,44 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/Comment", "@id": "/comments/1", "@type": "Comment", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Comment resource.", + "hydra:method": "GET", + "hydra:title": "getComment", + "returns": "Comment" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Comment", + "hydra:description": "Replaces the Comment resource.", + "hydra:method": "PUT", + "hydra:title": "putComment", + "returns": "Comment" + }, + { + "@type": "hydra:Operation", + "expects": "Comment", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Comment resource.", + "hydra:method": "PATCH", + "hydra:title": "patchComment", + "returns": "Comment" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Comment resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteComment", + "returns": "owl:Nothing" + } + ], "id": 1, "comment": "Lorem ipsum dolor sit amet 1", "date": "2015-03-01T10:00:00+00:00", diff --git a/features/main/crud_abstract.feature b/features/main/crud_abstract.feature index fc8bd66c69..93ea2aa3f6 100644 --- a/features/main/crud_abstract.feature +++ b/features/main/crud_abstract.feature @@ -24,6 +24,56 @@ Feature: Create-Retrieve-Update-Delete on abstract resource "@context": "/contexts/ConcreteDummy", "@id": "/concrete_dummies/1", "@type": "ConcreteDummy", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a ConcreteDummy resource.", + "hydra:method": "GET", + "hydra:title": "getConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "ConcreteDummy", + "hydra:description": "Replaces the ConcreteDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": "hydra:Operation", + "expects": "ConcreteDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the ConcreteDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the ConcreteDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteConcreteDummy", + "returns": "owl:Nothing" + } + ], "instance": "Concrete", "id": 1, "name": "My Dummy" @@ -42,6 +92,56 @@ Feature: Create-Retrieve-Update-Delete on abstract resource "@context": "/contexts/ConcreteDummy", "@id": "/concrete_dummies/1", "@type": "ConcreteDummy", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a ConcreteDummy resource.", + "hydra:method": "GET", + "hydra:title": "getConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "ConcreteDummy", + "hydra:description": "Replaces the ConcreteDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": "hydra:Operation", + "expects": "ConcreteDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the ConcreteDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the ConcreteDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteConcreteDummy", + "returns": "owl:Nothing" + } + ], "instance": "Concrete", "id": 1, "name": "My Dummy" @@ -101,6 +201,56 @@ Feature: Create-Retrieve-Update-Delete on abstract resource "@context": "/contexts/ConcreteDummy", "@id": "/concrete_dummies/1", "@type": "ConcreteDummy", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a ConcreteDummy resource.", + "hydra:method": "GET", + "hydra:title": "getConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "ConcreteDummy", + "hydra:description": "Replaces the ConcreteDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": "hydra:Operation", + "expects": "ConcreteDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the ConcreteDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the ConcreteDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteConcreteDummy", + "returns": "owl:Nothing" + } + ], "instance": "Become real", "id": 1, "name": "A nice dummy" @@ -127,6 +277,56 @@ Feature: Create-Retrieve-Update-Delete on abstract resource "@context": "/contexts/ConcreteDummy", "@id": "/concrete_dummies/1", "@type": "ConcreteDummy", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a ConcreteDummy resource.", + "hydra:method": "GET", + "hydra:title": "getConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "ConcreteDummy", + "hydra:description": "Replaces the ConcreteDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": "hydra:Operation", + "expects": "ConcreteDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the ConcreteDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the ConcreteDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteConcreteDummy", + "returns": "owl:Nothing" + } + ], "instance": "Become surreal", "id": 1, "name": "A nicer dummy" @@ -160,6 +360,56 @@ Feature: Create-Retrieve-Update-Delete on abstract resource "@context": "/contexts/ConcreteDummy", "@id": "/concrete_dummies/1", "@type": "ConcreteDummy", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a ConcreteDummy resource.", + "hydra:method": "GET", + "hydra:title": "getConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "ConcreteDummy", + "hydra:description": "Replaces the ConcreteDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": "hydra:Operation", + "expects": "ConcreteDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the ConcreteDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchConcreteDummy", + "returns": "ConcreteDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the ConcreteDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteConcreteDummy", + "returns": "owl:Nothing" + } + ], "instance": "Concrete", "id": 1, "name": "My Dummy" diff --git a/features/main/crud_uri_variables.feature b/features/main/crud_uri_variables.feature index 37787dc56d..9ea43e3e0b 100644 --- a/features/main/crud_uri_variables.feature +++ b/features/main/crud_uri_variables.feature @@ -21,9 +21,31 @@ Feature: Uri Variables "@context": "/contexts/Company", "@id": "/companies/1", "@type": "Company", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a Company resource.", + "hydra:method": "GET", + "hydra:title": "getCompany", + "returns": "Company" + }, + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a Company resource.", + "hydra:method": "GET", + "hydra:title": "getCompany", + "returns": "owl:Nothing" + } + ], "id": 1, "name": "Foo Company 1", - "employees": null + "employees": [] } """ @@ -172,9 +194,31 @@ Feature: Uri Variables "@context": "/contexts/Company", "@id": "/employees/1/company", "@type": "Company", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a Company resource.", + "hydra:method": "GET", + "hydra:title": "getCompany", + "returns": "Company" + }, + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a Company resource.", + "hydra:method": "GET", + "hydra:title": "getCompany", + "returns": "owl:Nothing" + } + ], "id": 1, "name": "Foo Company 1", - "employees": null + "employees": [] } """ diff --git a/features/main/custom_controller.feature b/features/main/custom_controller.feature index 16516099e5..64669d6fe0 100644 --- a/features/main/custom_controller.feature +++ b/features/main/custom_controller.feature @@ -16,6 +16,48 @@ Feature: Custom operation "@context": "/contexts/CustomActionDummy", "@id": "/custom_action_dummies/1", "@type": "CustomActionDummy", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomActionDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomActionDummy", + "returns": "CustomActionDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomActionDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomActionDummy", + "returns": "CustomActionDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomActionDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomActionDummy", + "returns": "CustomActionDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomActionDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomActionDummy", + "returns": "CustomActionDummy" + } + ], "id": 1, "foo": "custom!" } @@ -39,6 +81,48 @@ Feature: Custom operation "@context": "/contexts/CustomActionDummy", "@id": "/custom_action_dummies/2", "@type": "CustomActionDummy", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomActionDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomActionDummy", + "returns": "CustomActionDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomActionDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomActionDummy", + "returns": "CustomActionDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomActionDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomActionDummy", + "returns": "CustomActionDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomActionDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomActionDummy", + "returns": "CustomActionDummy" + } + ], "id": 2, "foo": "short declaration" } @@ -67,6 +151,48 @@ Feature: Custom operation "@context": "/contexts/CustomActionDummy", "@id": "/custom_action_collection_dummies/1", "@type": "CustomActionDummy", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomActionDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomActionDummy", + "returns": "CustomActionDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomActionDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomActionDummy", + "returns": "CustomActionDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomActionDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomActionDummy", + "returns": "CustomActionDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomActionDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomActionDummy", + "returns": "CustomActionDummy" + } + ], "id": 1, "foo": "custom!" } @@ -89,9 +215,21 @@ Feature: Custom operation "@context": "/contexts/Payment", "@id": "/payments/1", "@type": "Payment", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a Payment resource.", + "hydra:method": "GET", + "hydra:title": "getPayment", + "returns": "Payment" + } + ], "id": 1, - "amount": "123.45", - "voidPayment": null + "voidPayment": null, + "amount": "123.45" } """ @@ -108,9 +246,59 @@ Feature: Custom operation "@context": "/contexts/VoidPayment", "@id": "/void_payments/1", "@type": "VoidPayment", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a VoidPayment resource.", + "hydra:method": "GET", + "hydra:title": "getVoidPayment", + "returns": "VoidPayment" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "VoidPayment", + "hydra:description": "Replaces the VoidPayment resource.", + "hydra:method": "PUT", + "hydra:title": "putVoidPayment", + "returns": "VoidPayment" + }, + { + "@type": "hydra:Operation", + "expects": "VoidPayment", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the VoidPayment resource.", + "hydra:method": "PATCH", + "hydra:title": "patchVoidPayment", + "returns": "VoidPayment" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the VoidPayment resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteVoidPayment", + "returns": "owl:Nothing" + } + ], "id": 1, "payment": "/payments/1" - } + } """ Scenario: Get a void payment @@ -124,7 +312,57 @@ Feature: Custom operation "@context": "/contexts/VoidPayment", "@id": "/void_payments/1", "@type": "VoidPayment", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a VoidPayment resource.", + "hydra:method": "GET", + "hydra:title": "getVoidPayment", + "returns": "VoidPayment" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "VoidPayment", + "hydra:description": "Replaces the VoidPayment resource.", + "hydra:method": "PUT", + "hydra:title": "putVoidPayment", + "returns": "VoidPayment" + }, + { + "@type": "hydra:Operation", + "expects": "VoidPayment", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the VoidPayment resource.", + "hydra:method": "PATCH", + "hydra:title": "patchVoidPayment", + "returns": "VoidPayment" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the VoidPayment resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteVoidPayment", + "returns": "owl:Nothing" + } + ], "id": 1, "payment": "/payments/1" - } + } """ diff --git a/features/main/custom_identifier.feature b/features/main/custom_identifier.feature index 4af0178730..225bf55e8e 100644 --- a/features/main/custom_identifier.feature +++ b/features/main/custom_identifier.feature @@ -21,6 +21,56 @@ Feature: Using custom identifier on resource "@context": "/contexts/CustomIdentifierDummy", "@id": "/custom_identifier_dummies/1", "@type": "CustomIdentifierDummy", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomIdentifierDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomIdentifierDummy", + "returns": "CustomIdentifierDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "CustomIdentifierDummy", + "hydra:description": "Replaces the CustomIdentifierDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putCustomIdentifierDummy", + "returns": "CustomIdentifierDummy" + }, + { + "@type": "hydra:Operation", + "expects": "CustomIdentifierDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the CustomIdentifierDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCustomIdentifierDummy", + "returns": "CustomIdentifierDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the CustomIdentifierDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCustomIdentifierDummy", + "returns": "owl:Nothing" + } + ], "customId": 1, "name": "My Dummy" } @@ -37,6 +87,56 @@ Feature: Using custom identifier on resource "@context": "/contexts/CustomIdentifierDummy", "@id": "/custom_identifier_dummies/1", "@type": "CustomIdentifierDummy", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomIdentifierDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomIdentifierDummy", + "returns": "CustomIdentifierDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "CustomIdentifierDummy", + "hydra:description": "Replaces the CustomIdentifierDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putCustomIdentifierDummy", + "returns": "CustomIdentifierDummy" + }, + { + "@type": "hydra:Operation", + "expects": "CustomIdentifierDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the CustomIdentifierDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCustomIdentifierDummy", + "returns": "CustomIdentifierDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the CustomIdentifierDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCustomIdentifierDummy", + "returns": "owl:Nothing" + } + ], "customId": 1, "name": "My Dummy" } @@ -82,6 +182,56 @@ Feature: Using custom identifier on resource "@context": "/contexts/CustomIdentifierDummy", "@id": "/custom_identifier_dummies/1", "@type": "CustomIdentifierDummy", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomIdentifierDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomIdentifierDummy", + "returns": "CustomIdentifierDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "CustomIdentifierDummy", + "hydra:description": "Replaces the CustomIdentifierDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putCustomIdentifierDummy", + "returns": "CustomIdentifierDummy" + }, + { + "@type": "hydra:Operation", + "expects": "CustomIdentifierDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the CustomIdentifierDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCustomIdentifierDummy", + "returns": "CustomIdentifierDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the CustomIdentifierDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCustomIdentifierDummy", + "returns": "owl:Nothing" + } + ], "customId": 1, "name": "My Dummy modified" } @@ -114,6 +264,44 @@ Feature: Using custom identifier on resource "@context": "/contexts/CustomMultipleIdentifierDummy", "@id": "/custom_multiple_identifier_dummies/1/2", "@type": "CustomMultipleIdentifierDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a CustomMultipleIdentifierDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomMultipleIdentifierDummy", + "returns": "CustomMultipleIdentifierDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "CustomMultipleIdentifierDummy", + "hydra:description": "Replaces the CustomMultipleIdentifierDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putCustomMultipleIdentifierDummy", + "returns": "CustomMultipleIdentifierDummy" + }, + { + "@type": "hydra:Operation", + "expects": "CustomMultipleIdentifierDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the CustomMultipleIdentifierDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCustomMultipleIdentifierDummy", + "returns": "CustomMultipleIdentifierDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the CustomMultipleIdentifierDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCustomMultipleIdentifierDummy", + "returns": "owl:Nothing" + } + ], "firstId": 1, "secondId": 2, "name": "Orwell" diff --git a/features/main/custom_identifier_with_subresource.feature b/features/main/custom_identifier_with_subresource.feature index 74d9c65a4c..4e0817e6f1 100644 --- a/features/main/custom_identifier_with_subresource.feature +++ b/features/main/custom_identifier_with_subresource.feature @@ -21,6 +21,44 @@ Feature: Using custom parent identifier for resources "@context": "/contexts/SlugParentDummy", "@id": "/slug_parent_dummies/parent-dummy", "@type": "SlugParentDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a SlugParentDummy resource.", + "hydra:method": "GET", + "hydra:title": "getSlugParentDummy", + "returns": "SlugParentDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "SlugParentDummy", + "hydra:description": "Replaces the SlugParentDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putSlugParentDummy", + "returns": "SlugParentDummy" + }, + { + "@type": "hydra:Operation", + "expects": "SlugParentDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the SlugParentDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchSlugParentDummy", + "returns": "SlugParentDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the SlugParentDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteSlugParentDummy", + "returns": "owl:Nothing" + } + ], "id": 1, "slug": "parent-dummy", "childDummies": [] @@ -45,6 +83,44 @@ Feature: Using custom parent identifier for resources "@context": "/contexts/SlugChildDummy", "@id": "/slug_child_dummies/child-dummy", "@type": "SlugChildDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a SlugChildDummy resource.", + "hydra:method": "GET", + "hydra:title": "getSlugChildDummy", + "returns": "SlugChildDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "SlugChildDummy", + "hydra:description": "Replaces the SlugChildDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putSlugChildDummy", + "returns": "SlugChildDummy" + }, + { + "@type": "hydra:Operation", + "expects": "SlugChildDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the SlugChildDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchSlugChildDummy", + "returns": "SlugChildDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the SlugChildDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteSlugChildDummy", + "returns": "owl:Nothing" + } + ], "id": 1, "slug": "child-dummy", "parentDummy": "/slug_parent_dummies/parent-dummy" @@ -86,6 +162,44 @@ Feature: Using custom parent identifier for resources "@context": "/contexts/SlugParentDummy", "@id": "/slug_child_dummies/child-dummy/parent_dummy", "@type": "SlugParentDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a SlugParentDummy resource.", + "hydra:method": "GET", + "hydra:title": "getSlugParentDummy", + "returns": "SlugParentDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "SlugParentDummy", + "hydra:description": "Replaces the SlugParentDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putSlugParentDummy", + "returns": "SlugParentDummy" + }, + { + "@type": "hydra:Operation", + "expects": "SlugParentDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the SlugParentDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchSlugParentDummy", + "returns": "SlugParentDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the SlugParentDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteSlugParentDummy", + "returns": "owl:Nothing" + } + ], "id": 1, "slug": "parent-dummy", "childDummies": [ diff --git a/features/main/custom_normalized.feature b/features/main/custom_normalized.feature index 7d1a49f3fe..0bb23a8ff1 100644 --- a/features/main/custom_normalized.feature +++ b/features/main/custom_normalized.feature @@ -24,6 +24,44 @@ Feature: Using custom normalized entity "@context": "/contexts/CustomNormalizedDummy", "@id": "/custom_normalized_dummies/1", "@type": "CustomNormalizedDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a CustomNormalizedDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomNormalizedDummy", + "returns": "CustomNormalizedDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "CustomNormalizedDummy", + "hydra:description": "Replaces the CustomNormalizedDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putCustomNormalizedDummy", + "returns": "CustomNormalizedDummy" + }, + { + "@type": "hydra:Operation", + "expects": "CustomNormalizedDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the CustomNormalizedDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCustomNormalizedDummy", + "returns": "CustomNormalizedDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the CustomNormalizedDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCustomNormalizedDummy", + "returns": "owl:Nothing" + } + ], "id": 1, "name": "My Dummy", "alias": "My alias" @@ -117,6 +155,44 @@ Feature: Using custom normalized entity "@context": "/contexts/CustomNormalizedDummy", "@id": "/custom_normalized_dummies/1", "@type": "CustomNormalizedDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a CustomNormalizedDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomNormalizedDummy", + "returns": "CustomNormalizedDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "CustomNormalizedDummy", + "hydra:description": "Replaces the CustomNormalizedDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putCustomNormalizedDummy", + "returns": "CustomNormalizedDummy" + }, + { + "@type": "hydra:Operation", + "expects": "CustomNormalizedDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the CustomNormalizedDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCustomNormalizedDummy", + "returns": "CustomNormalizedDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the CustomNormalizedDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCustomNormalizedDummy", + "returns": "owl:Nothing" + } + ], "id": 1, "name": "My Dummy", "alias": "My alias" @@ -165,6 +241,44 @@ Feature: Using custom normalized entity "@context": "/contexts/CustomNormalizedDummy", "@id": "/custom_normalized_dummies/1", "@type": "CustomNormalizedDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a CustomNormalizedDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomNormalizedDummy", + "returns": "CustomNormalizedDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "CustomNormalizedDummy", + "hydra:description": "Replaces the CustomNormalizedDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putCustomNormalizedDummy", + "returns": "CustomNormalizedDummy" + }, + { + "@type": "hydra:Operation", + "expects": "CustomNormalizedDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the CustomNormalizedDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCustomNormalizedDummy", + "returns": "CustomNormalizedDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the CustomNormalizedDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCustomNormalizedDummy", + "returns": "owl:Nothing" + } + ], "id": 1, "name": "My Dummy modified", "alias": "My alias" @@ -189,6 +303,44 @@ Feature: Using custom normalized entity "@context": "/contexts/CustomNormalizedDummy", "@id": "/custom_normalized_dummies/1", "@type": "CustomNormalizedDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a CustomNormalizedDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomNormalizedDummy", + "returns": "CustomNormalizedDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "CustomNormalizedDummy", + "hydra:description": "Replaces the CustomNormalizedDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putCustomNormalizedDummy", + "returns": "CustomNormalizedDummy" + }, + { + "@type": "hydra:Operation", + "expects": "CustomNormalizedDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the CustomNormalizedDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCustomNormalizedDummy", + "returns": "CustomNormalizedDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the CustomNormalizedDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCustomNormalizedDummy", + "returns": "owl:Nothing" + } + ], "id": 1, "name": "My Dummy modified", "alias": "My alias" diff --git a/features/main/custom_put.feature b/features/main/custom_put.feature index 9b286b57cb..ccbe2dfc9c 100644 --- a/features/main/custom_put.feature +++ b/features/main/custom_put.feature @@ -22,6 +22,29 @@ Feature: Spec-compliant PUT support "@context": "/contexts/CustomPut", "@id": "/custom_puts/1", "@type": "CustomPut", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomPut resource.", + "hydra:method": "GET", + "hydra:title": "getCustomPut", + "returns": "CustomPut" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "CustomPut", + "hydra:description": "Replaces the CustomPut resource.", + "hydra:method": "PUT", + "hydra:title": "putCustomPut", + "returns": "CustomPut" + } + ], "id": 1, "foo": "a", "bar": "b" diff --git a/features/main/custom_writable_identifier.feature b/features/main/custom_writable_identifier.feature index 097d253b9a..430709db9d 100644 --- a/features/main/custom_writable_identifier.feature +++ b/features/main/custom_writable_identifier.feature @@ -24,6 +24,44 @@ Feature: Using custom writable identifier on resource "@context": "/contexts/CustomWritableIdentifierDummy", "@id": "/custom_writable_identifier_dummies/my_slug", "@type": "CustomWritableIdentifierDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a CustomWritableIdentifierDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomWritableIdentifierDummy", + "returns": "CustomWritableIdentifierDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "CustomWritableIdentifierDummy", + "hydra:description": "Replaces the CustomWritableIdentifierDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putCustomWritableIdentifierDummy", + "returns": "CustomWritableIdentifierDummy" + }, + { + "@type": "hydra:Operation", + "expects": "CustomWritableIdentifierDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the CustomWritableIdentifierDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCustomWritableIdentifierDummy", + "returns": "CustomWritableIdentifierDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the CustomWritableIdentifierDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCustomWritableIdentifierDummy", + "returns": "owl:Nothing" + } + ], "slug": "my_slug", "name": "My Dummy" } @@ -40,6 +78,44 @@ Feature: Using custom writable identifier on resource "@context": "/contexts/CustomWritableIdentifierDummy", "@id": "/custom_writable_identifier_dummies/my_slug", "@type": "CustomWritableIdentifierDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a CustomWritableIdentifierDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomWritableIdentifierDummy", + "returns": "CustomWritableIdentifierDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "CustomWritableIdentifierDummy", + "hydra:description": "Replaces the CustomWritableIdentifierDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putCustomWritableIdentifierDummy", + "returns": "CustomWritableIdentifierDummy" + }, + { + "@type": "hydra:Operation", + "expects": "CustomWritableIdentifierDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the CustomWritableIdentifierDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCustomWritableIdentifierDummy", + "returns": "CustomWritableIdentifierDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the CustomWritableIdentifierDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCustomWritableIdentifierDummy", + "returns": "owl:Nothing" + } + ], "slug": "my_slug", "name": "My Dummy" } @@ -88,6 +164,56 @@ Feature: Using custom writable identifier on resource "@context": "/contexts/CustomWritableIdentifierDummy", "@id": "/custom_writable_identifier_dummies/slug_modified", "@type": "CustomWritableIdentifierDummy", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a CustomWritableIdentifierDummy resource.", + "hydra:method": "GET", + "hydra:title": "getCustomWritableIdentifierDummy", + "returns": "CustomWritableIdentifierDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "CustomWritableIdentifierDummy", + "hydra:description": "Replaces the CustomWritableIdentifierDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putCustomWritableIdentifierDummy", + "returns": "CustomWritableIdentifierDummy" + }, + { + "@type": "hydra:Operation", + "expects": "CustomWritableIdentifierDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the CustomWritableIdentifierDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCustomWritableIdentifierDummy", + "returns": "CustomWritableIdentifierDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the CustomWritableIdentifierDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCustomWritableIdentifierDummy", + "returns": "owl:Nothing" + } + ], "slug": "slug_modified", "name": "My Dummy modified" } diff --git a/features/main/exposed_state.feature b/features/main/exposed_state.feature index 1915732f38..5b29044bf8 100644 --- a/features/main/exposed_state.feature +++ b/features/main/exposed_state.feature @@ -21,8 +21,58 @@ Feature: Expose persisted object state "@context": "/contexts/TruncatedDummy", "@id": "/truncated_dummies/1", "@type": "TruncatedDummy", - "value": "20.3", - "id": 1 + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a TruncatedDummy resource.", + "hydra:method": "GET", + "hydra:title": "getTruncatedDummy", + "returns": "TruncatedDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "TruncatedDummy", + "hydra:description": "Replaces the TruncatedDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putTruncatedDummy", + "returns": "TruncatedDummy" + }, + { + "@type": "hydra:Operation", + "expects": "TruncatedDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the TruncatedDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchTruncatedDummy", + "returns": "TruncatedDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the TruncatedDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteTruncatedDummy", + "returns": "owl:Nothing" + } + ], + "id": 1, + "value": "20.3" } """ @@ -42,7 +92,57 @@ Feature: Expose persisted object state "@context": "/contexts/TruncatedDummy", "@id": "/truncated_dummies/1", "@type": "TruncatedDummy", - "value": "42.4", - "id": 1 + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a TruncatedDummy resource.", + "hydra:method": "GET", + "hydra:title": "getTruncatedDummy", + "returns": "TruncatedDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "TruncatedDummy", + "hydra:description": "Replaces the TruncatedDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putTruncatedDummy", + "returns": "TruncatedDummy" + }, + { + "@type": "hydra:Operation", + "expects": "TruncatedDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the TruncatedDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchTruncatedDummy", + "returns": "TruncatedDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the TruncatedDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteTruncatedDummy", + "returns": "owl:Nothing" + } + ], + "id": 1, + "value": "42.4" } """ diff --git a/features/main/operation.feature b/features/main/operation.feature index 24a82890cf..81ad8674bf 100644 --- a/features/main/operation.feature +++ b/features/main/operation.feature @@ -21,6 +21,44 @@ Feature: Operation support "@context": "/contexts/ReadableOnlyProperty", "@id": "/readable_only_properties/1", "@type": "ReadableOnlyProperty", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a ReadableOnlyProperty resource.", + "hydra:method": "GET", + "hydra:title": "getReadableOnlyProperty", + "returns": "ReadableOnlyProperty" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "ReadableOnlyProperty", + "hydra:description": "Replaces the ReadableOnlyProperty resource.", + "hydra:method": "PUT", + "hydra:title": "putReadableOnlyProperty", + "returns": "ReadableOnlyProperty" + }, + { + "@type": "hydra:Operation", + "expects": "ReadableOnlyProperty", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the ReadableOnlyProperty resource.", + "hydra:method": "PATCH", + "hydra:title": "patchReadableOnlyProperty", + "returns": "ReadableOnlyProperty" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the ReadableOnlyProperty resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteReadableOnlyProperty", + "returns": "owl:Nothing" + } + ], "id": 1, "name": "Read only" } @@ -78,6 +116,22 @@ Feature: Operation support "@context": "/contexts/Book", "@id": "/books/by_isbn/9780451524935", "@type": "Book", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Book resource.", + "hydra:method": "GET", + "hydra:title": "getBook", + "returns": "Book" + }, + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Book resource.", + "hydra:method": "GET", + "hydra:title": "getBook", + "returns": "Book" + } + ], "name": "1984", "isbn": "9780451524935", "id": 1 diff --git a/features/main/operation_resource.feature b/features/main/operation_resource.feature index b4bd729fca..180fa3ef08 100644 --- a/features/main/operation_resource.feature +++ b/features/main/operation_resource.feature @@ -35,6 +35,55 @@ Feature: Resource operations "@context": "/contexts/OperationResource", "@id": "/operation_resources/1", "@type": "OperationResource", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a OperationResource resource.", + "hydra:method": "GET", + "hydra:title": "getOperationResource", + "returns": "OperationResource" + }, + { + "@type": "hydra:Operation", + "expects": "OperationResource", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json" + ] + } + ], + "hydra:description": "Updates the OperationResource resource.", + "hydra:method": "PATCH", + "hydra:title": "patchOperationResource", + "returns": "OperationResource" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "OperationResource", + "hydra:description": "Replaces the OperationResource resource.", + "hydra:method": "PUT", + "hydra:title": "putOperationResource", + "returns": "OperationResource" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the OperationResource resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteOperationResource", + "returns": "owl:Nothing" + } + ], "identifier": 1, "name": "Patched" } @@ -60,6 +109,55 @@ Feature: Resource operations "@context": "/contexts/OperationResource", "@id": "/operation_resources/1", "@type": "OperationResource", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a OperationResource resource.", + "hydra:method": "GET", + "hydra:title": "getOperationResource", + "returns": "OperationResource" + }, + { + "@type": "hydra:Operation", + "expects": "OperationResource", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json" + ] + } + ], + "hydra:description": "Updates the OperationResource resource.", + "hydra:method": "PATCH", + "hydra:title": "patchOperationResource", + "returns": "OperationResource" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "OperationResource", + "hydra:description": "Replaces the OperationResource resource.", + "hydra:method": "PUT", + "hydra:title": "putOperationResource", + "returns": "OperationResource" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the OperationResource resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteOperationResource", + "returns": "owl:Nothing" + } + ], "identifier": 1, "name": "Modified" } diff --git a/features/main/overridden_operation.feature b/features/main/overridden_operation.feature index d07181de8b..c7b9e8d53c 100644 --- a/features/main/overridden_operation.feature +++ b/features/main/overridden_operation.feature @@ -23,6 +23,30 @@ Feature: Create-Retrieve-Update-Delete with a Overridden Operation context "@context": "/contexts/OverriddenOperationDummy", "@id": "/overridden_operation_dummies/1", "@type": "OverriddenOperationDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a OverriddenOperationDummy resource.", + "hydra:method": "GET", + "hydra:title": "getOverriddenOperationDummy", + "returns": "OverriddenOperationDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "OverriddenOperationDummy", + "hydra:description": "Replaces the OverriddenOperationDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putOverriddenOperationDummy", + "returns": "OverriddenOperationDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the OverriddenOperationDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteOverriddenOperationDummy", + "returns": "owl:Nothing" + } + ], "name": "My Overridden Operation Dummy", "alias": null, "description": "Gerard" @@ -40,6 +64,30 @@ Feature: Create-Retrieve-Update-Delete with a Overridden Operation context "@context": "/contexts/OverriddenOperationDummy", "@id": "/overridden_operation_dummies/1", "@type": "OverriddenOperationDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a OverriddenOperationDummy resource.", + "hydra:method": "GET", + "hydra:title": "getOverriddenOperationDummy", + "returns": "OverriddenOperationDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "OverriddenOperationDummy", + "hydra:description": "Replaces the OverriddenOperationDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putOverriddenOperationDummy", + "returns": "OverriddenOperationDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the OverriddenOperationDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteOverriddenOperationDummy", + "returns": "owl:Nothing" + } + ], "name": "My Overridden Operation Dummy", "alias": null, "description": "Gerard" @@ -104,6 +152,30 @@ Feature: Create-Retrieve-Update-Delete with a Overridden Operation context "@context": "/contexts/OverriddenOperationDummy", "@id": "/overridden_operation_dummies/1", "@type": "OverriddenOperationDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a OverriddenOperationDummy resource.", + "hydra:method": "GET", + "hydra:title": "getOverriddenOperationDummy", + "returns": "OverriddenOperationDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "OverriddenOperationDummy", + "hydra:description": "Replaces the OverriddenOperationDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putOverriddenOperationDummy", + "returns": "OverriddenOperationDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the OverriddenOperationDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteOverriddenOperationDummy", + "returns": "owl:Nothing" + } + ], "alias": "Dummy", "description": "Gerard" } @@ -120,6 +192,30 @@ Feature: Create-Retrieve-Update-Delete with a Overridden Operation context "@context": "/contexts/OverriddenOperationDummy", "@id": "/overridden_operation_dummies/1", "@type": "OverriddenOperationDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a OverriddenOperationDummy resource.", + "hydra:method": "GET", + "hydra:title": "getOverriddenOperationDummy", + "returns": "OverriddenOperationDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "OverriddenOperationDummy", + "hydra:description": "Replaces the OverriddenOperationDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putOverriddenOperationDummy", + "returns": "OverriddenOperationDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the OverriddenOperationDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteOverriddenOperationDummy", + "returns": "owl:Nothing" + } + ], "name": "My Overridden Operation Dummy", "alias": "Dummy", "description": "Gerard" diff --git a/features/main/patch.feature b/features/main/patch.feature index d6be7ec543..e25bf33d3e 100644 --- a/features/main/patch.feature +++ b/features/main/patch.feature @@ -50,6 +50,29 @@ Feature: Sending PATCH requets "@context": "/contexts/PatchDummyRelation", "@id": "/patch_dummy_relations/1", "@type": "PatchDummyRelation", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a PatchDummyRelation resource.", + "hydra:method": "GET", + "hydra:title": "getPatchDummyRelation", + "returns": "PatchDummyRelation" + }, + { + "@type": "hydra:Operation", + "expects": "PatchDummyRelation", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the PatchDummyRelation resource.", + "hydra:method": "PATCH", + "hydra:title": "patchPatchDummyRelation", + "returns": "PatchDummyRelation" + } + ], "related": { "@id": "/related_dummies/1", "@type": "https://schema.org/Product", @@ -76,6 +99,29 @@ Feature: Sending PATCH requets "@context": "/contexts/Beta", "@id": "/betas/1", "@type": "Beta", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Beta resource.", + "hydra:method": "GET", + "hydra:title": "getBeta", + "returns": "owl:Nothing" + }, + { + "@type": "hydra:Operation", + "expects": "Beta", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Beta resource.", + "hydra:method": "PATCH", + "hydra:title": "patchBeta", + "returns": "Beta" + } + ], "betaId": 1, "alpha": "/alphas/2" } diff --git a/features/main/relation.feature b/features/main/relation.feature index 5eba540f96..681a0bca30 100644 --- a/features/main/relation.feature +++ b/features/main/relation.feature @@ -19,11 +19,61 @@ Feature: Relations support "@context": "/contexts/ThirdLevel", "@id": "/third_levels/1", "@type": "ThirdLevel", - "fourthLevel": null, - "badFourthLevel": null, + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a ThirdLevel resource.", + "hydra:method": "GET", + "hydra:title": "getThirdLevel", + "returns": "ThirdLevel" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "ThirdLevel", + "hydra:description": "Replaces the ThirdLevel resource.", + "hydra:method": "PUT", + "hydra:title": "putThirdLevel", + "returns": "ThirdLevel" + }, + { + "@type": "hydra:Operation", + "expects": "ThirdLevel", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the ThirdLevel resource.", + "hydra:method": "PATCH", + "hydra:title": "patchThirdLevel", + "returns": "ThirdLevel" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the ThirdLevel resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteThirdLevel", + "returns": "owl:Nothing" + } + ], "id": 1, "level": 3, "test": true, + "fourthLevel": null, + "badFourthLevel": null, "relatedDummies": [] } """ @@ -43,6 +93,56 @@ Feature: Relations support "@context": "/contexts/DummyFriend", "@id": "/dummy_friends/1", "@type": "DummyFriend", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a DummyFriend resource.", + "hydra:method": "GET", + "hydra:title": "getDummyFriend", + "returns": "DummyFriend" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "DummyFriend", + "hydra:description": "Replaces the DummyFriend resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyFriend", + "returns": "DummyFriend" + }, + { + "@type": "hydra:Operation", + "expects": "DummyFriend", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the DummyFriend resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummyFriend", + "returns": "DummyFriend" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the DummyFriend resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyFriend", + "returns": "owl:Nothing" + } + ], "id": 1, "name": "Zoidberg" } @@ -63,6 +163,56 @@ Feature: Relations support "@context": "/contexts/RelatedDummy", "@id": "/related_dummies/1", "@type": "https://schema.org/Product", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a RelatedDummy resource.", + "hydra:method": "GET", + "hydra:title": "getRelatedDummy", + "returns": "RelatedDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "RelatedDummy", + "hydra:description": "Replaces the RelatedDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putRelatedDummy", + "returns": "RelatedDummy" + }, + { + "@type": "hydra:Operation", + "expects": "RelatedDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the RelatedDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchRelatedDummy", + "returns": "RelatedDummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the RelatedDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteRelatedDummy", + "returns": "owl:Nothing" + } + ], "id": 1, "name": null, "symfony": "symfony", @@ -99,6 +249,56 @@ Feature: Relations support "@context": "/contexts/RelatedToDummyFriend", "@id": "/related_to_dummy_friends/dummyFriend=1;relatedDummy=1", "@type": "RelatedToDummyFriend", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a RelatedToDummyFriend resource.", + "hydra:method": "GET", + "hydra:title": "getRelatedToDummyFriend", + "returns": "RelatedToDummyFriend" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "RelatedToDummyFriend", + "hydra:description": "Replaces the RelatedToDummyFriend resource.", + "hydra:method": "PUT", + "hydra:title": "putRelatedToDummyFriend", + "returns": "RelatedToDummyFriend" + }, + { + "@type": "hydra:Operation", + "expects": "RelatedToDummyFriend", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the RelatedToDummyFriend resource.", + "hydra:method": "PATCH", + "hydra:title": "patchRelatedToDummyFriend", + "returns": "RelatedToDummyFriend" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the RelatedToDummyFriend resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteRelatedToDummyFriend", + "returns": "owl:Nothing" + } + ], "name": "Friends relation", "description": null, "dummyFriend": { @@ -121,6 +321,56 @@ Feature: Relations support "@context": "/contexts/RelatedToDummyFriend", "@id": "/related_to_dummy_friends/dummyFriend=1;relatedDummy=1", "@type": "RelatedToDummyFriend", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a RelatedToDummyFriend resource.", + "hydra:method": "GET", + "hydra:title": "getRelatedToDummyFriend", + "returns": "RelatedToDummyFriend" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "RelatedToDummyFriend", + "hydra:description": "Replaces the RelatedToDummyFriend resource.", + "hydra:method": "PUT", + "hydra:title": "putRelatedToDummyFriend", + "returns": "RelatedToDummyFriend" + }, + { + "@type": "hydra:Operation", + "expects": "RelatedToDummyFriend", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the RelatedToDummyFriend resource.", + "hydra:method": "PATCH", + "hydra:title": "patchRelatedToDummyFriend", + "returns": "RelatedToDummyFriend" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the RelatedToDummyFriend resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteRelatedToDummyFriend", + "returns": "owl:Nothing" + } + ], "name": "Friends relation", "description": null, "dummyFriend": { @@ -171,7 +421,57 @@ Feature: Relations support "id": 1, "name": "Dummy with relations", "alias": null, - "foo": null + "foo": null, + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a Dummy resource.", + "hydra:method": "GET", + "hydra:title": "getDummy", + "returns": "Dummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "Dummy", + "hydra:description": "Replaces the Dummy resource.", + "hydra:method": "PUT", + "hydra:title": "putDummy", + "returns": "Dummy" + }, + { + "@type": "hydra:Operation", + "expects": "Dummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the Dummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummy", + "returns": "Dummy" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the Dummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummy", + "returns": "owl:Nothing" + } + ] } """ @@ -262,6 +562,52 @@ Feature: Relations support "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/1", "@type": "RelationEmbedder", + "operation": [ + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Deletes the RelationEmbedder resource.", + "hydra:method": "DELETE", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + } + ], "krondstadt": "Krondstadt", "anotherRelated": null, "related": { @@ -273,9 +619,9 @@ Feature: Relations support "@type": "ThirdLevel", "level": 3, "fourthLevel": null - } + } } - } + } """ Scenario: Create an existing relation @@ -297,6 +643,52 @@ Feature: Relations support "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/2", "@type": "RelationEmbedder", + "operation": [ + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Deletes the RelationEmbedder resource.", + "hydra:method": "DELETE", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + } + ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/2", @@ -305,12 +697,12 @@ Feature: Relations support "thirdLevel": null }, "related": null - } + } """ Scenario: Update the relation with a new one When I add "Content-Type" header equal to "application/ld+json" - And I send a "PUT" request to "/relation_embedders/2" with body: + And I send a "PUT" request to "/relation_embedders/1" with body: """ { "anotherRelated": { @@ -325,8 +717,54 @@ Feature: Relations support """ { "@context": "/contexts/RelationEmbedder", - "@id": "/relation_embedders/2", + "@id": "/relation_embedders/1", "@type": "RelationEmbedder", + "operation": [ + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Deletes the RelationEmbedder resource.", + "hydra:method": "DELETE", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + } + ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/3", @@ -334,7 +772,17 @@ Feature: Relations support "symfony": "laravel2", "thirdLevel": null }, - "related": null + "related": { + "@id": "/related_dummies/1", + "@type": "https://schema.org/Product", + "symfony": "symfony", + "thirdLevel": { + "@id": "/third_levels/1", + "@type": "ThirdLevel", + "level": 3, + "fourthLevel": null + } + } } """ @@ -386,6 +834,52 @@ Feature: Relations support "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/2", "@type": "RelationEmbedder", + "operation": [ + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Deletes the RelationEmbedder resource.", + "hydra:method": "DELETE", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "hydra:description": "Retrieves a RelationEmbedder resource.", + "hydra:method": "GET", + "hydra:title": "A custom operation", + "returns": "xsd:string" + }, + { + "@type": "hydra:Operation", + "expects": "RelationEmbedder", + "hydra:description": "Replaces the RelationEmbedder resource.", + "hydra:method": "PUT", + "hydra:title": "A custom operation", + "returns": "xsd:string" + } + ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/2", @@ -394,7 +888,7 @@ Feature: Relations support "thirdLevel": null }, "related": null - } + } """ @createSchema diff --git a/features/main/serializable_item_data_provider.feature b/features/main/serializable_item_data_provider.feature index 11a111cf10..0e48cb4d65 100644 --- a/features/main/serializable_item_data_provider.feature +++ b/features/main/serializable_item_data_provider.feature @@ -11,6 +11,44 @@ Feature: Serializable item data provider "@context": "/contexts/SerializableResource", "@id": "/serializable_resources/1", "@type": "SerializableResource", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a SerializableResource resource.", + "hydra:method": "GET", + "hydra:title": "getSerializableResource", + "returns": "SerializableResource" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "SerializableResource", + "hydra:description": "Replaces the SerializableResource resource.", + "hydra:method": "PUT", + "hydra:title": "putSerializableResource", + "returns": "SerializableResource" + }, + { + "@type": "hydra:Operation", + "expects": "SerializableResource", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the SerializableResource resource.", + "hydra:method": "PATCH", + "hydra:title": "patchSerializableResource", + "returns": "SerializableResource" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the SerializableResource resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteSerializableResource", + "returns": "owl:Nothing" + } + ], "id": 1, "foo": "Lorem", "bar": "Ipsum" diff --git a/features/main/standard_put.feature b/features/main/standard_put.feature index 670ab6d0d0..2c13209afa 100644 --- a/features/main/standard_put.feature +++ b/features/main/standard_put.feature @@ -20,6 +20,23 @@ Feature: Spec-compliant PUT support "@context": "/contexts/StandardPut", "@id": "/standard_puts/5", "@type": "StandardPut", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a StandardPut resource.", + "hydra:method": "GET", + "hydra:title": "getStandardPut", + "returns": "StandardPut" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "StandardPut", + "hydra:description": "Replaces the StandardPut resource.", + "hydra:method": "PUT", + "hydra:title": "putStandardPut", + "returns": "StandardPut" + } + ], "id": 5, "foo": "a", "bar": "b" @@ -46,6 +63,23 @@ Feature: Spec-compliant PUT support "@context": "/contexts/StandardPut", "@id": "/standard_puts/6", "@type": "StandardPut", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a StandardPut resource.", + "hydra:method": "GET", + "hydra:title": "getStandardPut", + "returns": "StandardPut" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "StandardPut", + "hydra:description": "Replaces the StandardPut resource.", + "hydra:method": "PUT", + "hydra:title": "putStandardPut", + "returns": "StandardPut" + } + ], "id": 6, "foo": "a", "bar": "b" @@ -96,6 +130,23 @@ Feature: Spec-compliant PUT support "@context": "/contexts/StandardPut", "@id": "/standard_puts/5", "@type": "StandardPut", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a StandardPut resource.", + "hydra:method": "GET", + "hydra:title": "getStandardPut", + "returns": "StandardPut" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "StandardPut", + "hydra:description": "Replaces the StandardPut resource.", + "hydra:method": "PUT", + "hydra:title": "putStandardPut", + "returns": "StandardPut" + } + ], "id": 5, "foo": "c", "bar": "" @@ -121,7 +172,24 @@ Feature: Spec-compliant PUT support "@id": "/uid_identifieds/fbcf5910-d915-4f7d-ba39-6b2957c57335", "@type": "UidIdentified", "id": "fbcf5910-d915-4f7d-ba39-6b2957c57335", - "name": "test" + "name": "test", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a UidIdentified resource.", + "hydra:method": "GET", + "hydra:title": "getUidIdentified", + "returns": "owl:Nothing" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "UidIdentified", + "hydra:description": "Replaces the UidIdentified resource.", + "hydra:method": "PUT", + "hydra:title": "putUidIdentified", + "returns": "UidIdentified" + } + ] } """ @@ -143,6 +211,23 @@ Feature: Spec-compliant PUT support "@id": "/uid_identifieds/fbcf5910-d915-4f7d-ba39-6b2957c57335", "@type": "UidIdentified", "id": "fbcf5910-d915-4f7d-ba39-6b2957c57335", - "name": "bar" + "name": "bar", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a UidIdentified resource.", + "hydra:method": "GET", + "hydra:title": "getUidIdentified", + "returns": "owl:Nothing" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "UidIdentified", + "hydra:description": "Replaces the UidIdentified resource.", + "hydra:method": "PUT", + "hydra:title": "putUidIdentified", + "returns": "UidIdentified" + } + ] } """ diff --git a/features/main/sub_resource.feature b/features/main/sub_resource.feature index 1a8b9e14ad..2c3a974e6e 100644 --- a/features/main/sub_resource.feature +++ b/features/main/sub_resource.feature @@ -15,6 +15,44 @@ Feature: Sub-resource support "@context": "/contexts/Answer", "@id": "/questions/1/answer", "@type": "Answer", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Answer resource.", + "hydra:method": "GET", + "hydra:title": "getAnswer", + "returns": "Answer" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Answer", + "hydra:description": "Replaces the Answer resource.", + "hydra:method": "PUT", + "hydra:title": "putAnswer", + "returns": "Answer" + }, + { + "@type": "hydra:Operation", + "expects": "Answer", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Answer resource.", + "hydra:method": "PATCH", + "hydra:title": "patchAnswer", + "returns": "Answer" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Answer resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteAnswer", + "returns": "owl:Nothing" + } + ], "id": 1, "content": "42", "question": "/questions/1", @@ -332,6 +370,44 @@ Feature: Sub-resource support "@context": "/contexts/RelatedDummy", "@id": "/dummies/1/related_dummies/2", "@type": "https://schema.org/Product", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a RelatedDummy resource.", + "hydra:method": "GET", + "hydra:title": "getRelatedDummy", + "returns": "RelatedDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "RelatedDummy", + "hydra:description": "Replaces the RelatedDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putRelatedDummy", + "returns": "RelatedDummy" + }, + { + "@type": "hydra:Operation", + "expects": "RelatedDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the RelatedDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchRelatedDummy", + "returns": "RelatedDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the RelatedDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteRelatedDummy", + "returns": "owl:Nothing" + } + ], "id": 2, "name": null, "symfony": "symfony", @@ -372,6 +448,44 @@ Feature: Sub-resource support "@context": "/contexts/ThirdLevel", "@id": "/dummies/1/related_dummies/1/third_level", "@type": "ThirdLevel", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a ThirdLevel resource.", + "hydra:method": "GET", + "hydra:title": "getThirdLevel", + "returns": "ThirdLevel" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "ThirdLevel", + "hydra:description": "Replaces the ThirdLevel resource.", + "hydra:method": "PUT", + "hydra:title": "putThirdLevel", + "returns": "ThirdLevel" + }, + { + "@type": "hydra:Operation", + "expects": "ThirdLevel", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the ThirdLevel resource.", + "hydra:method": "PATCH", + "hydra:title": "patchThirdLevel", + "returns": "ThirdLevel" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the ThirdLevel resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteThirdLevel", + "returns": "owl:Nothing" + } + ], "fourthLevel": "/fourth_levels/1", "badFourthLevel": null, "id": 1, @@ -395,6 +509,44 @@ Feature: Sub-resource support "@context": "/contexts/FourthLevel", "@id": "/dummies/1/related_dummies/1/third_level/fourth_level", "@type": "FourthLevel", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a FourthLevel resource.", + "hydra:method": "GET", + "hydra:title": "getFourthLevel", + "returns": "FourthLevel" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "FourthLevel", + "hydra:description": "Replaces the FourthLevel resource.", + "hydra:method": "PUT", + "hydra:title": "putFourthLevel", + "returns": "FourthLevel" + }, + { + "@type": "hydra:Operation", + "expects": "FourthLevel", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the FourthLevel resource.", + "hydra:method": "PATCH", + "hydra:title": "patchFourthLevel", + "returns": "FourthLevel" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the FourthLevel resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteFourthLevel", + "returns": "owl:Nothing" + } + ], "badThirdLevel": [], "id": 1, "level": 4 @@ -488,10 +640,60 @@ Feature: Sub-resource support "@context": "/contexts/DummyProduct", "@id": "/dummy_products/2", "@type": "DummyProduct", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a DummyProduct resource.", + "hydra:method": "GET", + "hydra:title": "getDummyProduct", + "returns": "DummyProduct" + }, + { + "@type": [ + "hydra:Operation", + "schema:ReplaceAction" + ], + "expects": "DummyProduct", + "hydra:description": "Replaces the DummyProduct resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyProduct", + "returns": "DummyProduct" + }, + { + "@type": "hydra:Operation", + "expects": "DummyProduct", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": [ + "application/merge-patch+json", + "application/vnd.api+json" + ] + } + ], + "hydra:description": "Updates the DummyProduct resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummyProduct", + "returns": "DummyProduct" + }, + { + "@type": [ + "hydra:Operation", + "schema:DeleteAction" + ], + "hydra:description": "Deletes the DummyProduct resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyProduct", + "returns": "owl:Nothing" + } + ], + "id": 2, "offers": [ "/dummy_aggregate_offers/1" ], - "id": 2, "name": "Dummy product", "relatedProducts": [ "/dummy_products/1" @@ -513,6 +715,44 @@ Feature: Sub-resource support "@context": "/contexts/Dummy", "@id": "/related_owned_dummies/1/owning_dummy", "@type": "Dummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Dummy resource.", + "hydra:method": "GET", + "hydra:title": "getDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Dummy", + "hydra:description": "Replaces the Dummy resource.", + "hydra:method": "PUT", + "hydra:title": "putDummy", + "returns": "Dummy" + }, + { + "@type": "hydra:Operation", + "expects": "Dummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Dummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Dummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummy", + "returns": "owl:Nothing" + } + ], "description": null, "dummy": null, "dummyBoolean": null, @@ -546,6 +786,44 @@ Feature: Sub-resource support "@context": "/contexts/Dummy", "@id": "/related_owning_dummies/1/owned_dummy", "@type": "Dummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Dummy resource.", + "hydra:method": "GET", + "hydra:title": "getDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Dummy", + "hydra:description": "Replaces the Dummy resource.", + "hydra:method": "PUT", + "hydra:title": "putDummy", + "returns": "Dummy" + }, + { + "@type": "hydra:Operation", + "expects": "Dummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Dummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Dummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummy", + "returns": "owl:Nothing" + } + ], "description": null, "dummy": null, "dummyBoolean": null, diff --git a/features/main/table_inheritance.feature b/features/main/table_inheritance.feature index 1c3617f5f9..cd4e7b3263 100644 --- a/features/main/table_inheritance.feature +++ b/features/main/table_inheritance.feature @@ -544,6 +544,7 @@ Feature: Table inheritance "type": "string", "pattern": "^ResourceInterface$" }, + "operation": {"type": "array"}, "foo": { "type": "string", "pattern": "^single item$" diff --git a/features/main/url_encoded_id.feature b/features/main/url_encoded_id.feature index 6e5828bbab..b2b480c783 100644 --- a/features/main/url_encoded_id.feature +++ b/features/main/url_encoded_id.feature @@ -15,6 +15,15 @@ Feature: Allowing resource identifiers with characters that should be URL encode "@context": "/contexts/UrlEncodedId", "@id": "/url_encoded_ids/%25encode:id", "@type": "UrlEncodedId", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a UrlEncodedId resource.", + "hydra:method": "GET", + "hydra:title": "getUrlEncodedId", + "returns": "UrlEncodedId" + } + ], "id": "%encode:id" } """ diff --git a/features/main/uuid.feature b/features/main/uuid.feature index a7506a15be..53c3e45c9f 100644 --- a/features/main/uuid.feature +++ b/features/main/uuid.feature @@ -30,6 +30,44 @@ Feature: Using uuid identifier on resource "@context": "/contexts/UuidIdentifierDummy", "@id": "/uuid_identifier_dummies/41b29566-144b-11e6-a148-3e1d05defe78", "@type": "UuidIdentifierDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a UuidIdentifierDummy resource.", + "hydra:method": "GET", + "hydra:title": "getUuidIdentifierDummy", + "returns": "UuidIdentifierDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "UuidIdentifierDummy", + "hydra:description": "Replaces the UuidIdentifierDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putUuidIdentifierDummy", + "returns": "UuidIdentifierDummy" + }, + { + "@type": "hydra:Operation", + "expects": "UuidIdentifierDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the UuidIdentifierDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchUuidIdentifierDummy", + "returns": "UuidIdentifierDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the UuidIdentifierDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteUuidIdentifierDummy", + "returns": "owl:Nothing" + } + ], "uuid": "41b29566-144b-11e6-a148-3e1d05defe78", "name": "My Dummy" } @@ -76,6 +114,44 @@ Feature: Using uuid identifier on resource "@context": "/contexts/UuidIdentifierDummy", "@id": "/uuid_identifier_dummies/41b29566-144b-11e6-a148-3e1d05defe78", "@type": "UuidIdentifierDummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a UuidIdentifierDummy resource.", + "hydra:method": "GET", + "hydra:title": "getUuidIdentifierDummy", + "returns": "UuidIdentifierDummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "UuidIdentifierDummy", + "hydra:description": "Replaces the UuidIdentifierDummy resource.", + "hydra:method": "PUT", + "hydra:title": "putUuidIdentifierDummy", + "returns": "UuidIdentifierDummy" + }, + { + "@type": "hydra:Operation", + "expects": "UuidIdentifierDummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the UuidIdentifierDummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchUuidIdentifierDummy", + "returns": "UuidIdentifierDummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the UuidIdentifierDummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteUuidIdentifierDummy", + "returns": "owl:Nothing" + } + ], "uuid": "41b29566-144b-11e6-a148-3e1d05defe78", "name": "My Dummy modified" } @@ -98,6 +174,44 @@ Feature: Using uuid identifier on resource "@context": "/contexts/CustomGeneratedIdentifier", "@id": "/custom_generated_identifiers/foo", "@type": "CustomGeneratedIdentifier", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a CustomGeneratedIdentifier resource.", + "hydra:method": "GET", + "hydra:title": "getCustomGeneratedIdentifier", + "returns": "CustomGeneratedIdentifier" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "CustomGeneratedIdentifier", + "hydra:description": "Replaces the CustomGeneratedIdentifier resource.", + "hydra:method": "PUT", + "hydra:title": "putCustomGeneratedIdentifier", + "returns": "CustomGeneratedIdentifier" + }, + { + "@type": "hydra:Operation", + "expects": "CustomGeneratedIdentifier", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the CustomGeneratedIdentifier resource.", + "hydra:method": "PATCH", + "hydra:title": "patchCustomGeneratedIdentifier", + "returns": "CustomGeneratedIdentifier" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the CustomGeneratedIdentifier resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteCustomGeneratedIdentifier", + "returns": "owl:Nothing" + } + ], "id": "foo" } """ diff --git a/features/mercure/publish.feature b/features/mercure/publish.feature index ac0c27fa7e..d7397443d8 100644 --- a/features/mercure/publish.feature +++ b/features/mercure/publish.feature @@ -1,3 +1,4 @@ +@mercure Feature: Mercure publish support In order to publish an Update to the Mercure hub As a developer @@ -27,6 +28,15 @@ Feature: Mercure publish support "@context": "/contexts/MercureWithTopics", "@id": "/issue5074/mercure_with_topics/1", "@type": "MercureWithTopics", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a MercureWithTopics resource.", + "hydra:method": "GET", + "hydra:title": "getMercureWithTopics", + "returns": "MercureWithTopics" + } + ], "id": 1, "name": "Hello World!" } @@ -54,6 +64,22 @@ Feature: Mercure publish support "@context": "/contexts/MercureWithTopicsAndGetOperation", "@id": "/mercure_with_topics_and_get_operations/1", "@type": "MercureWithTopicsAndGetOperation", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a MercureWithTopicsAndGetOperation resource.", + "hydra:method": "GET", + "hydra:title": "getMercureWithTopicsAndGetOperation", + "returns": "MercureWithTopicsAndGetOperation" + }, + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a MercureWithTopicsAndGetOperation resource.", + "hydra:method": "GET", + "hydra:title": "getMercureWithTopicsAndGetOperation", + "returns": "MercureWithTopicsAndGetOperation" + } + ], "id": 1, "name": "Hello World!" } diff --git a/features/security/strong_typing.feature b/features/security/strong_typing.feature index 27e669816d..a720c96534 100644 --- a/features/security/strong_typing.feature +++ b/features/security/strong_typing.feature @@ -22,6 +22,44 @@ Feature: Handle properly invalid data submitted to the API "@context": "/contexts/Dummy", "@id": "/dummies/1", "@type": "Dummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Dummy resource.", + "hydra:method": "GET", + "hydra:title": "getDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Dummy", + "hydra:description": "Replaces the Dummy resource.", + "hydra:method": "PUT", + "hydra:title": "putDummy", + "returns": "Dummy" + }, + { + "@type": "hydra:Operation", + "expects": "Dummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Dummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Dummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummy", + "returns": "owl:Nothing" + } + ], "description": null, "dummy": null, "dummyBoolean": null, diff --git a/features/security/unknown_attributes.feature b/features/security/unknown_attributes.feature index efe7b954c0..5396147f0b 100644 --- a/features/security/unknown_attributes.feature +++ b/features/security/unknown_attributes.feature @@ -22,6 +22,44 @@ Feature: Ignore unknown attributes "@context": "/contexts/Dummy", "@id": "/dummies/1", "@type": "Dummy", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a Dummy resource.", + "hydra:method": "GET", + "hydra:title": "getDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "Dummy", + "hydra:description": "Replaces the Dummy resource.", + "hydra:method": "PUT", + "hydra:title": "putDummy", + "returns": "Dummy" + }, + { + "@type": "hydra:Operation", + "expects": "Dummy", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the Dummy resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummy", + "returns": "Dummy" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the Dummy resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummy", + "returns": "owl:Nothing" + } + ], "description": null, "dummy": null, "dummyBoolean": null, diff --git a/features/serializer/empty_array_as_object.feature b/features/serializer/empty_array_as_object.feature index c0cc854817..9f6f0b4e4f 100644 --- a/features/serializer/empty_array_as_object.feature +++ b/features/serializer/empty_array_as_object.feature @@ -16,6 +16,15 @@ Feature: Serialize empty array as object "@context": "/contexts/EmptyArrayAsObject", "@id": "/empty_array_as_objects/6", "@type": "EmptyArrayAsObject", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a EmptyArrayAsObject resource.", + "hydra:method": "GET", + "hydra:title": "getEmptyArrayAsObject", + "returns": "EmptyArrayAsObject" + } + ], "id": 6, "emptyArray": [], "emptyArrayAsObject": {}, diff --git a/features/serializer/group_filter.feature b/features/serializer/group_filter.feature index 95de871d40..f2f5ab9803 100644 --- a/features/serializer/group_filter.feature +++ b/features/serializer/group_filter.feature @@ -554,6 +554,7 @@ Feature: Filter with serialization groups on items and collections "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, "@type": {"pattern": "^DummyGroup$"}, + "operation": {"type": "array"}, "id": {}, "foo": {}, "bar": {}, @@ -577,6 +578,7 @@ Feature: Filter with serialization groups on items and collections "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, "@type": {"pattern": "^DummyGroup$"}, + "operation": {"type": "array"}, "foo": {} }, "additionalProperties": false, @@ -597,6 +599,7 @@ Feature: Filter with serialization groups on items and collections "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, "@type": {"pattern": "^DummyGroup$"}, + "operation": {"type": "array"}, "id": {}, "foo": {}, "bar": {}, @@ -621,6 +624,7 @@ Feature: Filter with serialization groups on items and collections "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, "@type": {"pattern": "^DummyGroup$"}, + "operation": {"type": "array"}, "foo": {}, "qux": {} }, @@ -642,6 +646,7 @@ Feature: Filter with serialization groups on items and collections "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, "@type": {"pattern": "^DummyGroup$"}, + "operation": {"type": "array"}, "id": {}, "foo": {}, "bar": {}, @@ -665,6 +670,7 @@ Feature: Filter with serialization groups on items and collections "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, "@type": {"pattern": "^DummyGroup$"}, + "operation": {"type": "array"}, "foo": {} }, "additionalProperties": false, @@ -685,6 +691,7 @@ Feature: Filter with serialization groups on items and collections "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, "@type": {"pattern": "^DummyGroup$"}, + "operation": {"type": "array"}, "id": {}, "foo": {}, "bar": {}, @@ -707,7 +714,8 @@ Feature: Filter with serialization groups on items and collections "properties": { "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, - "@type": {"pattern": "^DummyGroup$"} + "@type": {"pattern": "^DummyGroup$"}, + "operation": {"type": "array"} }, "additionalProperties": false, "required": ["@context", "@id", "@type"] @@ -734,6 +742,44 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/11", "@type": "DummyGroup", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a DummyGroup resource.", + "hydra:method": "GET", + "hydra:title": "getDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "DummyGroup", + "hydra:description": "Replaces the DummyGroup resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": "hydra:Operation", + "expects": "DummyGroup", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the DummyGroup resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the DummyGroup resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyGroup", + "returns": "owl:Nothing" + } + ], "id": 11, "foo": "Foo", "bar": "Bar", @@ -761,6 +807,44 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/12", "@type": "DummyGroup", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a DummyGroup resource.", + "hydra:method": "GET", + "hydra:title": "getDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "DummyGroup", + "hydra:description": "Replaces the DummyGroup resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": "hydra:Operation", + "expects": "DummyGroup", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the DummyGroup resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the DummyGroup resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyGroup", + "returns": "owl:Nothing" + } + ], "foo": "Foo" } """ @@ -785,6 +869,44 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/13", "@type": "DummyGroup", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a DummyGroup resource.", + "hydra:method": "GET", + "hydra:title": "getDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "DummyGroup", + "hydra:description": "Replaces the DummyGroup resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": "hydra:Operation", + "expects": "DummyGroup", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the DummyGroup resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the DummyGroup resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyGroup", + "returns": "owl:Nothing" + } + ], "id": 13, "foo": "Foo", "bar": "Bar", @@ -813,6 +935,44 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/14", "@type": "DummyGroup", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a DummyGroup resource.", + "hydra:method": "GET", + "hydra:title": "getDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "DummyGroup", + "hydra:description": "Replaces the DummyGroup resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": "hydra:Operation", + "expects": "DummyGroup", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the DummyGroup resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the DummyGroup resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyGroup", + "returns": "owl:Nothing" + } + ], "foo": "Foo", "baz": "Baz", "qux": "Qux" @@ -839,6 +999,44 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/15", "@type": "DummyGroup", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a DummyGroup resource.", + "hydra:method": "GET", + "hydra:title": "getDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "DummyGroup", + "hydra:description": "Replaces the DummyGroup resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": "hydra:Operation", + "expects": "DummyGroup", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the DummyGroup resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the DummyGroup resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyGroup", + "returns": "owl:Nothing" + } + ], "id": 15, "foo": "Foo", "bar": "Bar", @@ -867,6 +1065,44 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/16", "@type": "DummyGroup", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a DummyGroup resource.", + "hydra:method": "GET", + "hydra:title": "getDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "DummyGroup", + "hydra:description": "Replaces the DummyGroup resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": "hydra:Operation", + "expects": "DummyGroup", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the DummyGroup resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the DummyGroup resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyGroup", + "returns": "owl:Nothing" + } + ], "id": 16, "foo": "Foo", "bar": "Bar", @@ -895,6 +1131,44 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/17", "@type": "DummyGroup", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a DummyGroup resource.", + "hydra:method": "GET", + "hydra:title": "getDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "DummyGroup", + "hydra:description": "Replaces the DummyGroup resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": "hydra:Operation", + "expects": "DummyGroup", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the DummyGroup resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the DummyGroup resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyGroup", + "returns": "owl:Nothing" + } + ], "id": 17, "foo": "Foo", "bar": "Bar", @@ -921,7 +1195,45 @@ Feature: Filter with serialization groups on items and collections { "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/18", - "@type": "DummyGroup" + "@type": "DummyGroup", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a DummyGroup resource.", + "hydra:method": "GET", + "hydra:title": "getDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "DummyGroup", + "hydra:description": "Replaces the DummyGroup resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": "hydra:Operation", + "expects": "DummyGroup", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the DummyGroup resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the DummyGroup resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyGroup", + "returns": "owl:Nothing" + } + ] } """ @@ -945,6 +1257,44 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/19", "@type": "DummyGroup", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a DummyGroup resource.", + "hydra:method": "GET", + "hydra:title": "getDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "DummyGroup", + "hydra:description": "Replaces the DummyGroup resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": "hydra:Operation", + "expects": "DummyGroup", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the DummyGroup resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the DummyGroup resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyGroup", + "returns": "owl:Nothing" + } + ], "id": 19, "foo": "Foo", "bar": "Bar", @@ -972,6 +1322,44 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/20", "@type": "DummyGroup", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a DummyGroup resource.", + "hydra:method": "GET", + "hydra:title": "getDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "DummyGroup", + "hydra:description": "Replaces the DummyGroup resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": "hydra:Operation", + "expects": "DummyGroup", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the DummyGroup resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummyGroup", + "returns": "DummyGroup" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the DummyGroup resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyGroup", + "returns": "owl:Nothing" + } + ], "baz": "Baz" } """ diff --git a/features/serializer/property_filter.feature b/features/serializer/property_filter.feature index 7da85deb69..23e99d67d6 100644 --- a/features/serializer/property_filter.feature +++ b/features/serializer/property_filter.feature @@ -285,6 +285,7 @@ Feature: Filter with serialization attributes on items and collections "@context": {"pattern": "^/contexts/DummyProperty$"}, "@id": {"pattern": "^/dummy_properties/1$"}, "@type": {"pattern": "^DummyProperty$"}, + "operation": {"type": "array"}, "id": {}, "foo": {}, "bar": {} @@ -307,6 +308,7 @@ Feature: Filter with serialization attributes on items and collections "@context": {"pattern": "^/contexts/DummyProperty$"}, "@id": {"pattern": "^/dummy_properties/1$"}, "@type": {"pattern": "^DummyProperty$"}, + "operation": {"type": "array"}, "foo": {}, "bar": {}, "group": { @@ -314,6 +316,7 @@ Feature: Filter with serialization attributes on items and collections "properties": { "@id": {}, "@type": {}, + "operation": {"type": "array"}, "baz": {} }, "additionalProperties": false, @@ -338,11 +341,13 @@ Feature: Filter with serialization attributes on items and collections "@context": {"pattern": "^/contexts/DummyProperty$"}, "@id": {"pattern": "^/dummy_properties/1$"}, "@type": {"pattern": "^DummyProperty$"}, + "operation": {"type": "array"}, "group": { "type": "object", "properties": { "@id": {}, - "@type": {} + "@type": {}, + "operation": {"type": "array"} }, "additionalProperties": false, "required": ["@id", "@type"] @@ -371,6 +376,44 @@ Feature: Filter with serialization attributes on items and collections "@context": "/contexts/DummyProperty", "@id": "/dummy_properties/11", "@type": "DummyProperty", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a DummyProperty resource.", + "hydra:method": "GET", + "hydra:title": "getDummyProperty", + "returns": "DummyProperty" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "DummyProperty", + "hydra:description": "Replaces the DummyProperty resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyProperty", + "returns": "DummyProperty" + }, + { + "@type": "hydra:Operation", + "expects": "DummyProperty", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the DummyProperty resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummyProperty", + "returns": "DummyProperty" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the DummyProperty resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyProperty", + "returns": "owl:Nothing" + } + ], "foo": "Foo", "bar": "Bar" } @@ -399,6 +442,44 @@ Feature: Filter with serialization attributes on items and collections "@context": "/contexts/DummyProperty", "@id": "/dummy_properties/12", "@type": "DummyProperty", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a DummyProperty resource.", + "hydra:method": "GET", + "hydra:title": "getDummyProperty", + "returns": "DummyProperty" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "DummyProperty", + "hydra:description": "Replaces the DummyProperty resource.", + "hydra:method": "PUT", + "hydra:title": "putDummyProperty", + "returns": "DummyProperty" + }, + { + "@type": "hydra:Operation", + "expects": "DummyProperty", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the DummyProperty resource.", + "hydra:method": "PATCH", + "hydra:title": "patchDummyProperty", + "returns": "DummyProperty" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the DummyProperty resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteDummyProperty", + "returns": "owl:Nothing" + } + ], "foo": "Foo", "bar": "Bar", "group": { diff --git a/features/serializer/vo_relations.feature b/features/serializer/vo_relations.feature index 08999440a5..6ae69c8d9b 100644 --- a/features/serializer/vo_relations.feature +++ b/features/serializer/vo_relations.feature @@ -30,6 +30,44 @@ Feature: Value object as ApiResource "@context": "/contexts/VoDummyCar", "@id": "/vo_dummy_cars/1", "@type": "VoDummyCar", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a VoDummyCar resource.", + "hydra:method": "GET", + "hydra:title": "getVoDummyCar", + "returns": "VoDummyCar" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "VoDummyCar", + "hydra:description": "Replaces the VoDummyCar resource.", + "hydra:method": "PUT", + "hydra:title": "putVoDummyCar", + "returns": "VoDummyCar" + }, + { + "@type": "hydra:Operation", + "expects": "VoDummyCar", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the VoDummyCar resource.", + "hydra:method": "PATCH", + "hydra:title": "patchVoDummyCar", + "returns": "VoDummyCar" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the VoDummyCar resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteVoDummyCar", + "returns": "owl:Nothing" + } + ], "mileage": 1500, "bodyType": "suv", "inspections": [], @@ -96,9 +134,47 @@ Feature: Value object as ApiResource "@context": "/contexts/VoDummyInspection", "@id": "/vo_dummy_inspections/1", "@type": "VoDummyInspection", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a VoDummyInspection resource.", + "hydra:method": "GET", + "hydra:title": "getVoDummyInspection", + "returns": "VoDummyInspection" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "VoDummyInspection", + "hydra:description": "Replaces the VoDummyInspection resource.", + "hydra:method": "PUT", + "hydra:title": "putVoDummyInspection", + "returns": "VoDummyInspection" + }, + { + "@type": "hydra:Operation", + "expects": "VoDummyInspection", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the VoDummyInspection resource.", + "hydra:method": "PATCH", + "hydra:title": "patchVoDummyInspection", + "returns": "VoDummyInspection" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the VoDummyInspection resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteVoDummyInspection", + "returns": "owl:Nothing" + } + ], + "performed": "2018-08-24T00:00:00+00:00", "accepted": true, - "car": "/vo_dummy_cars/1", - "performed": "2018-08-24T00:00:00+00:00" + "car": "/vo_dummy_cars/1" } """ @@ -118,9 +194,47 @@ Feature: Value object as ApiResource "@context": "/contexts/VoDummyInspection", "@id": "/vo_dummy_inspections/1", "@type": "VoDummyInspection", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a VoDummyInspection resource.", + "hydra:method": "GET", + "hydra:title": "getVoDummyInspection", + "returns": "VoDummyInspection" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "VoDummyInspection", + "hydra:description": "Replaces the VoDummyInspection resource.", + "hydra:method": "PUT", + "hydra:title": "putVoDummyInspection", + "returns": "VoDummyInspection" + }, + { + "@type": "hydra:Operation", + "expects": "VoDummyInspection", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the VoDummyInspection resource.", + "hydra:method": "PATCH", + "hydra:title": "patchVoDummyInspection", + "returns": "VoDummyInspection" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the VoDummyInspection resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteVoDummyInspection", + "returns": "owl:Nothing" + } + ], + "performed": "2018-08-24T00:00:00+00:00", "accepted": true, - "car": "/vo_dummy_cars/1", - "performed": "2018-08-24T00:00:00+00:00" + "car": "/vo_dummy_cars/1" } """ @@ -187,15 +301,47 @@ Feature: Value object as ApiResource "@context": "/contexts/VoDummyCar", "@id": "/vo_dummy_cars/1", "@type": "VoDummyCar", + "operation": [ + { + "@type": ["hydra:Operation", "schema:FindAction"], + "hydra:description": "Retrieves a VoDummyCar resource.", + "hydra:method": "GET", + "hydra:title": "getVoDummyCar", + "returns": "VoDummyCar" + }, + { + "@type": ["hydra:Operation", "schema:ReplaceAction"], + "expects": "VoDummyCar", + "hydra:description": "Replaces the VoDummyCar resource.", + "hydra:method": "PUT", + "hydra:title": "putVoDummyCar", + "returns": "VoDummyCar" + }, + { + "@type": "hydra:Operation", + "expects": "VoDummyCar", + "expectsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] + } + ], + "hydra:description": "Updates the VoDummyCar resource.", + "hydra:method": "PATCH", + "hydra:title": "patchVoDummyCar", + "returns": "VoDummyCar" + }, + { + "@type": ["hydra:Operation", "schema:DeleteAction"], + "hydra:description": "Deletes the VoDummyCar resource.", + "hydra:method": "DELETE", + "hydra:title": "deleteVoDummyCar", + "returns": "owl:Nothing" + } + ], + "inspections": [], "mileage": 1500, "bodyType": "coupe", - "inspections": [], - "make": "CustomCar", - "insuranceCompany": { - "@id": "/vo_dummy_insurance_companies/1", - "@type": "VoDummyInsuranceCompany", - "name": "Safe Drive Company" - }, "drivers": [ { "@id": "/vo_dummy_drivers/1", @@ -203,7 +349,13 @@ Feature: Value object as ApiResource "firstName": "John", "lastName": "Doe" } - ] + ], + "make": "CustomCar", + "insuranceCompany": { + "@id": "/vo_dummy_insurance_companies/1", + "@type": "VoDummyInsuranceCompany", + "name": "Safe Drive Company" + } } """ And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8" diff --git a/features/sub_resources/multiple_relation.feature b/features/sub_resources/multiple_relation.feature index c774257aa3..6511d23f6e 100644 --- a/features/sub_resources/multiple_relation.feature +++ b/features/sub_resources/multiple_relation.feature @@ -21,6 +21,18 @@ Feature: JSON-LD multi relation "@context": "/contexts/RelationMultiple", "@id": "/dummy/1/relations/2", "@type": "RelationMultiple", + "operation": [ + { + "@type": [ + "hydra:Operation", + "schema:FindAction" + ], + "hydra:description": "Retrieves a RelationMultiple resource.", + "hydra:method": "GET", + "hydra:title": "getRelationMultiple", + "returns": "RelationMultiple" + } + ], "id": 1, "first": "/dummies/1", "second": "/dummies/2" From c2c2c7b34a7ac79ed1d6ea609f8fd88046fe108f Mon Sep 17 00:00:00 2001 From: Maxcastel Date: Fri, 3 Apr 2026 17:08:50 +0200 Subject: [PATCH 6/9] feat: add 'hydra_operations' option (replaced with 'hydra_item_operations_in_collection') --- src/JsonLd/Serializer/ItemNormalizer.php | 8 +++----- src/Laravel/config/api-platform.php | 2 +- .../Bundle/DependencyInjection/ApiPlatformExtension.php | 2 +- src/Symfony/Bundle/DependencyInjection/Configuration.php | 2 +- tests/Fixtures/app/config/config_common.yml | 2 ++ .../Bundle/DependencyInjection/ConfigurationTest.php | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/JsonLd/Serializer/ItemNormalizer.php b/src/JsonLd/Serializer/ItemNormalizer.php index d27af9db27..51b6b9f8fa 100644 --- a/src/JsonLd/Serializer/ItemNormalizer.php +++ b/src/JsonLd/Serializer/ItemNormalizer.php @@ -117,7 +117,6 @@ public function normalize(mixed $data, ?string $format = null, array $context = // TODO: we should not remove the resource_class in the normalizeRawCollection as we would find out anyway that it's not the same as the requested one $previousResourceClass = $context['resource_class'] ?? null; $metadata = []; - $isRootResource = !isset($context['jsonld_has_context']); if ($isResourceClass = $this->resourceClassResolver->isResourceClass($resourceClass) && (null === $previousResourceClass || $this->resourceClassResolver->isResourceClass($previousResourceClass))) { $resourceClass = $this->resourceClassResolver->getResourceClass($data, $previousResourceClass); if (isset($context['operation']) && $context['operation'] instanceof HttpOperation && $context['operation']->getClass() !== $resourceClass) { @@ -192,11 +191,10 @@ public function normalize(mixed $data, ?string $format = null, array $context = $metadata['@type'] = 1 === \count($types) ? $types[0] : $types; } - if ($isResourceClass && !is_a($resourceClass, ErrorResourceInterface::class, true) && $isRootResource) { - $isCollectionRoute = $context['api_collection_sub_level'] ?? false; - $showItemHydraOperationsInCollection = $context['hydra_item_operations_in_collection'] ?? false; + if ($isResourceClass && !is_a($resourceClass, ErrorResourceInterface::class, true)) { + $showOperations = $context['hydra_operations'] ?? false; - if (!$isCollectionRoute || $showItemHydraOperationsInCollection) { + if ($showOperations) { $hydraOperations = $this->getHydraOperations( false, $this->resourceMetadataCollectionFactory->create($resourceClass)[0], diff --git a/src/Laravel/config/api-platform.php b/src/Laravel/config/api-platform.php index 74f4af3bf4..94fc677154 100644 --- a/src/Laravel/config/api-platform.php +++ b/src/Laravel/config/api-platform.php @@ -149,7 +149,7 @@ 'serializer' => [ 'hydra_prefix' => false, - 'hydra_item_operations_in_collection' => false, + 'hydra_operations' => false, // 'datetime_format' => \DateTimeInterface::RFC3339, ], diff --git a/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php b/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php index c34675ed95..c36577e3a0 100644 --- a/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php +++ b/src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php @@ -334,7 +334,7 @@ private function registerCommonConfiguration(ContainerBuilder $container, array $defaultContext = [ 'hydra_prefix' => $config['serializer']['hydra_prefix'], - 'hydra_item_operations_in_collection' => $config['serializer']['hydra_item_operations_in_collection'], + 'hydra_operations' => $config['serializer']['hydra_operations'], ] + ($container->hasParameter('serializer.default_context') ? $container->getParameter('serializer.default_context') : []); $container->setParameter('api_platform.serializer.default_context', $defaultContext); diff --git a/src/Symfony/Bundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/DependencyInjection/Configuration.php index c7e7a48e5b..f5953a9696 100644 --- a/src/Symfony/Bundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/DependencyInjection/Configuration.php @@ -172,7 +172,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->addDefaultsIfNotSet() ->children() ->booleanNode('hydra_prefix')->defaultFalse()->info('Use the "hydra:" prefix.')->end() - ->booleanNode('hydra_item_operations_in_collection')->defaultFalse()->info('Include Hydra item operations on each member of a collection response. Disabled by default to reduce payload size.')->end() + ->booleanNode('hydra_operations')->defaultFalse()->info('Add the "operation" field to Hydra responses. Disabled by default to avoid breaking changes.')->end() ->end() ->end() ->end(); diff --git a/tests/Fixtures/app/config/config_common.yml b/tests/Fixtures/app/config/config_common.yml index 1320c1e263..ba86b4f476 100644 --- a/tests/Fixtures/app/config/config_common.yml +++ b/tests/Fixtures/app/config/config_common.yml @@ -38,6 +38,8 @@ api_platform: Made with love enable_swagger: true enable_swagger_ui: true + serializer: + hydra_operations: false formats: jsonld: ['application/ld+json'] jsonhal: ['application/hal+json'] diff --git a/tests/Symfony/Bundle/DependencyInjection/ConfigurationTest.php b/tests/Symfony/Bundle/DependencyInjection/ConfigurationTest.php index b7af7327ff..3873f26d70 100644 --- a/tests/Symfony/Bundle/DependencyInjection/ConfigurationTest.php +++ b/tests/Symfony/Bundle/DependencyInjection/ConfigurationTest.php @@ -243,7 +243,7 @@ private function runDefaultConfigTests(array $doctrineIntegrationsToLoad = ['orm 'enable_link_security' => true, 'serializer' => [ 'hydra_prefix' => false, - 'hydra_item_operations_in_collection' => false, + 'hydra_operations' => false, ], 'enable_phpdoc_parser' => true, 'mcp' => [ From c2cc727e67d6283bb295cb5383bc458b192c6ba8 Mon Sep 17 00:00:00 2001 From: Maxcastel Date: Fri, 3 Apr 2026 17:17:12 +0200 Subject: [PATCH 7/9] Revert "fix: fix tests" This reverts commit a5826297ac2766370e3eb91217a85cdde5837559. --- tests/Functional/BackedEnumResourceTest.php | 27 ------------------- tests/Functional/MathNumberTest.php | 18 ------------- .../JsonLd/Serializer/ItemNormalizerTest.php | 17 +++++------- tests/Symfony/Bundle/Test/ApiTestCaseTest.php | 6 ----- 4 files changed, 7 insertions(+), 61 deletions(-) diff --git a/tests/Functional/BackedEnumResourceTest.php b/tests/Functional/BackedEnumResourceTest.php index 09f872c5b0..94abdf7492 100644 --- a/tests/Functional/BackedEnumResourceTest.php +++ b/tests/Functional/BackedEnumResourceTest.php @@ -69,15 +69,6 @@ public static function providerEnumItemsJson(): iterable '@context' => '/contexts/Availability', '@id' => '/availabilities/'.$case->value, '@type' => 'Availability', - 'operation' => [ - [ - '@type' => ['hydra:Operation', 'schema:FindAction'], - 'hydra:method' => 'GET', - 'hydra:title' => 'getAvailability', - 'hydra:description' => 'Retrieves a Availability resource.', - 'returns' => 'Availability', - ], - ], 'value' => $case->value, ]]; } @@ -109,15 +100,6 @@ public static function providerEnumItemsJson(): iterable '@context' => '/contexts/AvailabilityStatus', '@id' => '/availability_statuses/'.$case->value, '@type' => 'AvailabilityStatus', - 'operation' => [ - [ - '@type' => ['hydra:Operation', 'schema:FindAction'], - 'hydra:method' => 'GET', - 'hydra:title' => 'getAvailabilityStatus', - 'hydra:description' => 'Retrieves a AvailabilityStatus resource.', - 'returns' => 'AvailabilityStatus', - ], - ], 'value' => $case->value, ]]; } @@ -475,15 +457,6 @@ public static function providerItem(): iterable '@context' => '/contexts/BackedEnumIntegerResource', '@id' => '/backed_enum_integer_resources/1', '@type' => 'BackedEnumIntegerResource', - 'operation' => [ - [ - '@type' => ['hydra:Operation', 'schema:FindAction'], - 'hydra:method' => 'GET', - 'hydra:title' => 'getBackedEnumIntegerResource', - 'hydra:description' => 'Retrieves a BackedEnumIntegerResource resource.', - 'returns' => 'BackedEnumIntegerResource', - ], - ], 'name' => 'Yes', 'value' => 1, 'description' => 'We say yes', diff --git a/tests/Functional/MathNumberTest.php b/tests/Functional/MathNumberTest.php index b0c4fc657b..04dab45903 100644 --- a/tests/Functional/MathNumberTest.php +++ b/tests/Functional/MathNumberTest.php @@ -54,15 +54,6 @@ public function testGetMathNumber(): void '@context' => '/contexts/MathNumber', '@id' => '/math_numbers/1', '@type' => 'MathNumber', - 'operation' => [ - [ - '@type' => ['hydra:Operation', 'schema:FindAction'], - 'hydra:method' => 'GET', - 'hydra:title' => 'getMathNumber', - 'hydra:description' => 'Retrieves a MathNumber resource.', - 'returns' => 'MathNumber', - ], - ], 'id' => 1, 'value' => '300.55', ]); @@ -83,15 +74,6 @@ public function testPostMathNumber(): void '@context' => '/contexts/MathNumber', '@id' => '/math_numbers/2', '@type' => 'MathNumber', - 'operation' => [ - [ - '@type' => ['hydra:Operation', 'schema:FindAction'], - 'hydra:method' => 'GET', - 'hydra:title' => 'getMathNumber', - 'hydra:description' => 'Retrieves a MathNumber resource.', - 'returns' => 'MathNumber', - ], - ], 'id' => 2, 'value' => '120.23', ]); diff --git a/tests/JsonLd/Serializer/ItemNormalizerTest.php b/tests/JsonLd/Serializer/ItemNormalizerTest.php index ed60add58b..d765b85a2e 100644 --- a/tests/JsonLd/Serializer/ItemNormalizerTest.php +++ b/tests/JsonLd/Serializer/ItemNormalizerTest.php @@ -90,15 +90,12 @@ public function testNormalize(): void ); $normalizer->setSerializer($serializerProphecy->reveal()); - $result = $normalizer->normalize($dummy); - - $this->assertEquals('/contexts/Dummy', $result['@context']); - $this->assertEquals('/dummies/1988', $result['@id']); - $this->assertEquals('Dummy', $result['@type']); - $this->assertEquals('hello', $result['name']); - - $this->assertArrayHasKey('operation', $result); - $this->assertIsArray($result['operation']); - $this->assertCount(1, $result['operation']); + $expected = [ + '@context' => '/contexts/Dummy', + '@id' => '/dummies/1988', + '@type' => 'Dummy', + 'name' => 'hello', + ]; + $this->assertEquals($expected, $normalizer->normalize($dummy)); } } diff --git a/tests/Symfony/Bundle/Test/ApiTestCaseTest.php b/tests/Symfony/Bundle/Test/ApiTestCaseTest.php index d1c9782e6e..422d1e558c 100644 --- a/tests/Symfony/Bundle/Test/ApiTestCaseTest.php +++ b/tests/Symfony/Bundle/Test/ApiTestCaseTest.php @@ -365,12 +365,6 @@ public function testGetMercureMessages(): void "readOnly": true, "type": "string" }, - "operation": { - "type": "array", - "items": { - "type": "object" - } - }, "id": { "type": "number" }, From 7a3e19f9a74fdd295b306cc52b0d76745fb712bc Mon Sep 17 00:00:00 2001 From: Maxcastel Date: Fri, 3 Apr 2026 17:17:57 +0200 Subject: [PATCH 8/9] Revert "fix: mercure" This reverts commit e2fd9a1909a35192eb9d221813f58e3b27db4e37. --- tests/Behat/CommandContext.php | 9 +-------- tests/Behat/MercureContext.php | 5 +---- .../app/config/config_behat_mercure.yml | 18 ------------------ .../app/config/config_behat_mongodb.yml | 3 +-- tests/Fixtures/app/config/config_behat_orm.yml | 3 +-- 5 files changed, 4 insertions(+), 34 deletions(-) delete mode 100644 tests/Fixtures/app/config/config_behat_mercure.yml diff --git a/tests/Behat/CommandContext.php b/tests/Behat/CommandContext.php index ad32c3292d..666f387410 100644 --- a/tests/Behat/CommandContext.php +++ b/tests/Behat/CommandContext.php @@ -18,7 +18,6 @@ use Behat\Gherkin\Node\TableNode; use GraphQL\Error\Error; use PHPUnit\Framework\Assert; -use Psr\Container\ContainerInterface; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Tester\CommandTester; @@ -35,9 +34,7 @@ final class CommandContext implements Context private ?CommandTester $commandTester = null; - private ?KernelInterface $kernel = null; - - public function __construct(private readonly ContainerInterface $driverContainer) + public function __construct(private KernelInterface $kernel) { } @@ -95,10 +92,6 @@ public function getApplication(): Application return $this->application; } - if (null === $this->kernel) { - $this->kernel = $this->driverContainer->get('kernel'); - } - $this->application = new Application($this->kernel); return $this->application; diff --git a/tests/Behat/MercureContext.php b/tests/Behat/MercureContext.php index 868d5d0ccd..2dbd68f877 100644 --- a/tests/Behat/MercureContext.php +++ b/tests/Behat/MercureContext.php @@ -103,10 +103,7 @@ public function mercureUpdateShouldHaveData(int $index, PyStringNode $data): voi } /** @var Update $update */ $update = $updates[$index - 1]; - - $expectedData = json_decode($data->getRaw(), true, 512, \JSON_THROW_ON_ERROR); - $actualData = json_decode($update->getData(), true, 512, \JSON_THROW_ON_ERROR); - Assert::assertEquals($expectedData, $actualData); + Assert::assertJsonStringEqualsJsonString($data->getRaw(), $update->getData()); } /** diff --git a/tests/Fixtures/app/config/config_behat_mercure.yml b/tests/Fixtures/app/config/config_behat_mercure.yml deleted file mode 100644 index 447d3026b3..0000000000 --- a/tests/Fixtures/app/config/config_behat_mercure.yml +++ /dev/null @@ -1,18 +0,0 @@ -services: - _defaults: - autowire: true - autoconfigure: true - - ApiPlatform\Tests\Behat\CommandContext: - $driverContainer: '@behat.driver.service_container' - ApiPlatform\Tests\Behat\DoctrineContext: - $doctrine: '@doctrine' - ApiPlatform\Tests\Behat\HttpCacheContext: ~ - ApiPlatform\Tests\Behat\HydraContext: ~ - ApiPlatform\Tests\Behat\JsonApiContext: - $doctrine: '@doctrine' - $jsonApiSchemaFile: '%kernel.project_dir%/../JsonSchema/jsonapi.json' - ApiPlatform\Tests\Behat\JsonHalContext: - $schemaFile: '%kernel.project_dir%/../JsonHal/jsonhal.json' - ApiPlatform\Tests\Behat\MercureContext: - $driverContainer: '@behat.driver.service_container' diff --git a/tests/Fixtures/app/config/config_behat_mongodb.yml b/tests/Fixtures/app/config/config_behat_mongodb.yml index c21f9a16ad..d5974d086c 100644 --- a/tests/Fixtures/app/config/config_behat_mongodb.yml +++ b/tests/Fixtures/app/config/config_behat_mongodb.yml @@ -3,8 +3,7 @@ services: autowire: true autoconfigure: true - ApiPlatform\Tests\Behat\CommandContext: - $driverContainer: '@behat.driver.service_container' + ApiPlatform\Tests\Behat\CommandContext: ~ ApiPlatform\Tests\Behat\DoctrineContext: $doctrine: '@doctrine_mongodb' ApiPlatform\Tests\Behat\HttpCacheContext: ~ diff --git a/tests/Fixtures/app/config/config_behat_orm.yml b/tests/Fixtures/app/config/config_behat_orm.yml index d677c871e1..da76d75622 100644 --- a/tests/Fixtures/app/config/config_behat_orm.yml +++ b/tests/Fixtures/app/config/config_behat_orm.yml @@ -4,8 +4,7 @@ services: autowire: true autoconfigure: true - ApiPlatform\Tests\Behat\CommandContext: - $driverContainer: '@behat.driver.service_container' + ApiPlatform\Tests\Behat\CommandContext: ~ ApiPlatform\Tests\Behat\DoctrineContext: $doctrine: '@doctrine' ApiPlatform\Tests\Behat\HttpCacheContext: ~ From acb3b53a53ddaedef73de6da99fde70b65be3fda Mon Sep 17 00:00:00 2001 From: Maxcastel Date: Fri, 3 Apr 2026 17:18:24 +0200 Subject: [PATCH 9/9] Revert "fix: fix Behat" This reverts commit cfad5d4b97da9fc391f561e5fa123ebafd93def2. --- features/doctrine/boolean_filter.feature | 1 - features/doctrine/date_filter.feature | 1 - features/doctrine/exists_filter.feature | 1 - .../standard_put_entity_inheritence.feature | 23 - features/doctrine/numeric_filter.feature | 1 - features/doctrine/order_filter.feature | 3 - features/doctrine/range_filter.feature | 1 - features/elasticsearch/read.feature | 66 --- .../http_cache/tag_collector_service.feature | 46 -- features/hydra/error.feature | 42 -- features/hydra/item_uri_template.feature | 2 - features/json/relation.feature | 303 +---------- features/jsonld/absolute_url.feature | 84 +-- .../jsonld/getter_setter_renaming.feature | 38 -- features/jsonld/input_output.feature | 123 +---- features/jsonld/interface_as_resource.feature | 76 --- features/jsonld/json_serializable.feature | 76 --- features/jsonld/network_path.feature | 84 +-- features/main/attribute_resource.feature | 99 ---- features/main/circular_reference.feature | 114 ---- features/main/composite.feature | 100 ---- features/main/configurable.feature | 38 -- features/main/crud.feature | 217 -------- features/main/crud_abstract.feature | 250 --------- features/main/crud_uri_variables.feature | 48 +- features/main/custom_controller.feature | 246 +-------- features/main/custom_identifier.feature | 188 ------- ...custom_identifier_with_subresource.feature | 114 ---- features/main/custom_normalized.feature | 152 ------ features/main/custom_put.feature | 23 - .../main/custom_writable_identifier.feature | 126 ----- features/main/exposed_state.feature | 108 +--- features/main/operation.feature | 54 -- features/main/operation_resource.feature | 98 ---- features/main/overridden_operation.feature | 96 ---- features/main/patch.feature | 46 -- features/main/relation.feature | 514 +----------------- .../serializable_item_data_provider.feature | 38 -- features/main/standard_put.feature | 89 +-- features/main/sub_resource.feature | 280 +--------- features/main/table_inheritance.feature | 1 - features/main/url_encoded_id.feature | 9 - features/main/uuid.feature | 114 ---- features/mercure/publish.feature | 26 - features/security/strong_typing.feature | 38 -- features/security/unknown_attributes.feature | 38 -- .../serializer/empty_array_as_object.feature | 9 - features/serializer/group_filter.feature | 392 +------------ features/serializer/property_filter.feature | 83 +-- features/serializer/vo_relations.feature | 176 +----- .../sub_resources/multiple_relation.feature | 12 - 51 files changed, 53 insertions(+), 4854 deletions(-) diff --git a/features/doctrine/boolean_filter.feature b/features/doctrine/boolean_filter.feature index b6b9ce19d6..e3332eea7b 100644 --- a/features/doctrine/boolean_filter.feature +++ b/features/doctrine/boolean_filter.feature @@ -471,7 +471,6 @@ Feature: Boolean filter on collections "properties": { "@id": {"pattern": "^/converted_booleans/(2|4)$"}, "@type": {"pattern": "^ConvertedBoolean"}, - "operation": {"type": "array"}, "name_converted": {"type": "boolean"}, "id": {"type": "integer", "minimum":2, "maximum": 4} }, diff --git a/features/doctrine/date_filter.feature b/features/doctrine/date_filter.feature index 0247bb45e2..7d8d1a906f 100644 --- a/features/doctrine/date_filter.feature +++ b/features/doctrine/date_filter.feature @@ -582,7 +582,6 @@ Feature: Date filter on collections "properties": { "@id": {"pattern": "^/converted_dates/(29|30)$"}, "@type": {"pattern": "^ConvertedDate"}, - "operation": {"type": "array"}, "name_converted": {"type": "string"}, "id": {"type": "integer", "minimum":29, "maximum": 30} }, diff --git a/features/doctrine/exists_filter.feature b/features/doctrine/exists_filter.feature index 73295c0daa..e99f2ff445 100644 --- a/features/doctrine/exists_filter.feature +++ b/features/doctrine/exists_filter.feature @@ -169,7 +169,6 @@ Feature: Exists filter on collections "properties": { "@id": {"pattern": "^/converted_strings/(1|3)$"}, "@type": {"pattern": "^ConvertedString"}, - "operation": {"type": "array"}, "name_converted": {"pattern": "^name#(1|3)$"}, "id": {"type": "integer", "minimum":1, "maximum": 3} }, diff --git a/features/doctrine/issue6175/standard_put_entity_inheritence.feature b/features/doctrine/issue6175/standard_put_entity_inheritence.feature index 70341e4fae..07d0d7e88c 100644 --- a/features/doctrine/issue6175/standard_put_entity_inheritence.feature +++ b/features/doctrine/issue6175/standard_put_entity_inheritence.feature @@ -19,29 +19,6 @@ Feature: Update properties of a resource that are inherited with standard PUT op "@context": "/contexts/DummyMappedSubclass", "@id": "/dummy_mapped_subclasses/1", "@type": "DummyMappedSubclass", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a DummyMappedSubclass resource.", - "hydra:method": "GET", - "hydra:title": "getDummyMappedSubclass", - "returns": "owl:Nothing" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "DummyMappedSubclass", - "hydra:description": "Replaces the DummyMappedSubclass resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyMappedSubclass", - "returns": "DummyMappedSubclass" - } - ], "id": 1, "foo": "updated value" } diff --git a/features/doctrine/numeric_filter.feature b/features/doctrine/numeric_filter.feature index adaa0c549b..ec449ae0be 100644 --- a/features/doctrine/numeric_filter.feature +++ b/features/doctrine/numeric_filter.feature @@ -159,7 +159,6 @@ Feature: Numeric filter on collections "properties": { "@id": {"pattern": "^/converted_integers/(2|3)$"}, "@type": {"pattern": "^ConvertedInteger$"}, - "operation": {"type": "array"}, "name_converted": {"type": "integer"}, "id": {"type": "integer", "minimum":2, "maximum": 3} }, diff --git a/features/doctrine/order_filter.feature b/features/doctrine/order_filter.feature index 729900ec9e..4d3d5587b9 100644 --- a/features/doctrine/order_filter.feature +++ b/features/doctrine/order_filter.feature @@ -733,7 +733,6 @@ Feature: Order filter on collections "properties": { "@id": {"pattern": "^/converted_integers/3$"}, "@type": {"pattern": "^ConvertedInteger$"}, - "operation": {"type": "array"}, "name_converted": {"type": "integer"}, "id": {"type": "integer", "minimum":3, "maximum": 3} }, @@ -745,7 +744,6 @@ Feature: Order filter on collections "properties": { "@id": {"pattern": "^/converted_integers/2$"}, "@type": {"pattern": "^ConvertedInteger$"}, - "operation": {"type": "array"}, "name_converted": {"type": "integer"}, "id": {"type": "integer", "minimum":2, "maximum": 2} }, @@ -757,7 +755,6 @@ Feature: Order filter on collections "properties": { "@id": {"pattern": "^/converted_integers/1$"}, "@type": {"pattern": "^ConvertedInteger$"}, - "operation": {"type": "array"}, "name_converted": {"type": "integer"}, "id": {"type": "integer", "minimum":1, "maximum": 1} }, diff --git a/features/doctrine/range_filter.feature b/features/doctrine/range_filter.feature index 263ea26c56..9a9ec12d07 100644 --- a/features/doctrine/range_filter.feature +++ b/features/doctrine/range_filter.feature @@ -447,7 +447,6 @@ Feature: Range filter on collections "properties": { "@id": {"pattern": "^/converted_integers/(1|2)$"}, "@type": {"pattern": "^ConvertedInteger$"}, - "operation": {"type": "array"}, "name_converted": {"type": "integer"}, "id": {"type": "integer", "minimum":1, "maximum": 2} }, diff --git a/features/elasticsearch/read.feature b/features/elasticsearch/read.feature index 7308a3a37c..226acafaf6 100644 --- a/features/elasticsearch/read.feature +++ b/features/elasticsearch/read.feature @@ -15,39 +15,6 @@ Feature: Retrieve from Elasticsearch "@context": "/contexts/User", "@id": "/users/116b83f8-6c32-48d8-8e28-c5c247532d3f", "@type": "User", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a User resource.", - "hydra:method": "GET", - "hydra:title": "getUser", - "returns": "User" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "User", - "hydra:description": "Replaces the User resource.", - "hydra:method": "PUT", - "hydra:title": "putUser", - "returns": "User" - }, - { - "@type": "hydra:Operation", - "expects": "User", - "expectsHeader": [{"headerName": "Content-Type", "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"]}], - "hydra:description": "Updates the User resource.", - "hydra:method": "PATCH", - "hydra:title": "patchUser", - "returns": "User" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the User resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteUser", - "returns": "owl:Nothing" - } - ], "id": "116b83f8-6c32-48d8-8e28-c5c247532d3f", "gender": "male", "age": 31, @@ -425,39 +392,6 @@ Feature: Retrieve from Elasticsearch "@context": "/contexts/Library", "@id": "/libraries/116b83f8-6c32-48d8-8e28-c5c247532d3f", "@type": "Library", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Library resource.", - "hydra:method": "GET", - "hydra:title": "getLibrary", - "returns": "Library" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Library", - "hydra:description": "Replaces the Library resource.", - "hydra:method": "PUT", - "hydra:title": "putLibrary", - "returns": "Library" - }, - { - "@type": "hydra:Operation", - "expects": "Library", - "expectsHeader": [{"headerName": "Content-Type", "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"]}], - "hydra:description": "Updates the Library resource.", - "hydra:method": "PATCH", - "hydra:title": "patchLibrary", - "returns": "Library" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Library resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteLibrary", - "returns": "owl:Nothing" - } - ], "id": "116b83f8-6c32-48d8-8e28-c5c247532d3f", "gender": "male", "age": 31, diff --git a/features/http_cache/tag_collector_service.feature b/features/http_cache/tag_collector_service.feature index 7b5dbcc53d..ed994aadb7 100644 --- a/features/http_cache/tag_collector_service.feature +++ b/features/http_cache/tag_collector_service.feature @@ -46,52 +46,6 @@ Feature: Cache invalidation through HTTP Cache tags (custom TagCollector service "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/2", "@type": "RelationEmbedder", - "operation": [ - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Deletes the RelationEmbedder resource.", - "hydra:method": "DELETE", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - } - ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/1", diff --git a/features/hydra/error.feature b/features/hydra/error.feature index acf29793b7..07fe8210f0 100644 --- a/features/hydra/error.feature +++ b/features/hydra/error.feature @@ -40,48 +40,6 @@ Feature: Error handling "@context": "/contexts/ConstraintViolation", "@id": "/validation_errors/c1051bb4-d103-4f74-8988-acbcafc7fdc3", "@type": "ConstraintViolation", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a ConstraintViolation resource.", - "hydra:method": "GET", - "hydra:title": "getConstraintViolation", - "returns": "ConstraintViolation" - }, - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a ConstraintViolation resource.", - "hydra:method": "GET", - "hydra:title": "getConstraintViolation", - "returns": "ConstraintViolation" - }, - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a ConstraintViolation resource.", - "hydra:method": "GET", - "hydra:title": "getConstraintViolation", - "returns": "ConstraintViolation" - }, - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a ConstraintViolation resource.", - "hydra:method": "GET", - "hydra:title": "getConstraintViolation", - "returns": "ConstraintViolation" - } - ], "status": 422, "violations": [ { diff --git a/features/hydra/item_uri_template.feature b/features/hydra/item_uri_template.feature index 14b2b693fd..0c73283235 100644 --- a/features/hydra/item_uri_template.feature +++ b/features/hydra/item_uri_template.feature @@ -99,7 +99,6 @@ Feature: Exposing a collection of objects should use the specified operation to "@context": {"pattern": "^/contexts/Car$"}, "@id": {"pattern": "^/cars/.+$"}, "@type": {"pattern": "^Car$"}, - "operation": {"type": "array"}, "id": {"type": "string"}, "owner": {"type": "string"} } @@ -127,7 +126,6 @@ Feature: Exposing a collection of objects should use the specified operation to "@context": {"pattern": "^/contexts/Car$"}, "@id": {"pattern": "^/brands/renault/cars/.+$"}, "@type": {"pattern": "^Car$"}, - "operation": {"type": "array"}, "id": {"type": "string"}, "owner": {"type": "string"} } diff --git a/features/json/relation.feature b/features/json/relation.feature index 3236de41f3..3455d9d412 100644 --- a/features/json/relation.feature +++ b/features/json/relation.feature @@ -21,39 +21,6 @@ Feature: JSON relations support "@context": "/contexts/ThirdLevel", "@id": "/third_levels/1", "@type": "ThirdLevel", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a ThirdLevel resource.", - "hydra:method": "GET", - "hydra:title": "getThirdLevel", - "returns": "ThirdLevel" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "ThirdLevel", - "hydra:description": "Replaces the ThirdLevel resource.", - "hydra:method": "PUT", - "hydra:title": "putThirdLevel", - "returns": "ThirdLevel" - }, - { - "@type": "hydra:Operation", - "expects": "ThirdLevel", - "expectsHeader": [{"headerName": "Content-Type", "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"]}], - "hydra:description": "Updates the ThirdLevel resource.", - "hydra:method": "PATCH", - "hydra:title": "patchThirdLevel", - "returns": "ThirdLevel" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the ThirdLevel resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteThirdLevel", - "returns": "owl:Nothing" - } - ], "fourthLevel": null, "badFourthLevel": null, "id": 1, @@ -82,52 +49,6 @@ Feature: JSON relations support "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/1", "@type": "RelationEmbedder", - "operation": [ - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Deletes the RelationEmbedder resource.", - "hydra:method": "DELETE", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - } - ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/1", @@ -158,52 +79,6 @@ Feature: JSON relations support "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/1", "@type": "RelationEmbedder", - "operation": [ - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Deletes the RelationEmbedder resource.", - "hydra:method": "DELETE", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - } - ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/2", @@ -235,52 +110,6 @@ Feature: JSON relations support "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/1", "@type": "RelationEmbedder", - "operation": [ - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Deletes the RelationEmbedder resource.", - "hydra:method": "DELETE", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - } - ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/1", @@ -312,52 +141,6 @@ Feature: JSON relations support "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/1", "@type": "RelationEmbedder", - "operation": [ - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Deletes the RelationEmbedder resource.", - "hydra:method": "DELETE", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - } - ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/1", @@ -386,44 +169,6 @@ Feature: JSON relations support "@context": "/contexts/RelatedDummy", "@id": "/related_dummies/3", "@type": "https://schema.org/Product", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a RelatedDummy resource.", - "hydra:method": "GET", - "hydra:title": "getRelatedDummy", - "returns": "RelatedDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "RelatedDummy", - "hydra:description": "Replaces the RelatedDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putRelatedDummy", - "returns": "RelatedDummy" - }, - { - "@type": "hydra:Operation", - "expects": "RelatedDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the RelatedDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchRelatedDummy", - "returns": "RelatedDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the RelatedDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteRelatedDummy", - "returns": "owl:Nothing" - } - ], "id": 3, "name": null, "symfony": "symfony", @@ -461,48 +206,6 @@ Feature: JSON relations support "@context": "/contexts/Dummy", "@id": "/dummies/1", "@type": "Dummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Dummy resource.", - "hydra:method": "GET", - "hydra:title": "getDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Dummy", - "hydra:description": "Replaces the Dummy resource.", - "hydra:method": "PUT", - "hydra:title": "putDummy", - "returns": "Dummy" - }, - { - "@type": "hydra:Operation", - "expects": "Dummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Dummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Dummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummy", - "returns": "owl:Nothing" - } - ], - "id": 1, - "name": "Dummy with plain relations", - "alias": null, - "foo": null, "description": null, "dummy": null, "dummyBoolean": null, @@ -517,6 +220,10 @@ Feature: JSON relations support "arrayData": [], "name_converted": null, "relatedOwnedDummy": null, - "relatedOwningDummy": null + "relatedOwningDummy": null, + "id": 1, + "name": "Dummy with plain relations", + "alias": null, + "foo": null } """ diff --git a/features/jsonld/absolute_url.feature b/features/jsonld/absolute_url.feature index 49478c052d..9770e6bbb7 100644 --- a/features/jsonld/absolute_url.feature +++ b/features/jsonld/absolute_url.feature @@ -42,46 +42,8 @@ Feature: IRI should contain Absolute URL "@context": "http://example.com/contexts/AbsoluteUrlRelationDummy", "@id": "http://example.com/absolute_url_relation_dummies/2", "@type": "AbsoluteUrlRelationDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a AbsoluteUrlRelationDummy resource.", - "hydra:method": "GET", - "hydra:title": "getAbsoluteUrlRelationDummy", - "returns": "AbsoluteUrlRelationDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "AbsoluteUrlRelationDummy", - "hydra:description": "Replaces the AbsoluteUrlRelationDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putAbsoluteUrlRelationDummy", - "returns": "AbsoluteUrlRelationDummy" - }, - { - "@type": "hydra:Operation", - "expects": "AbsoluteUrlRelationDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the AbsoluteUrlRelationDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchAbsoluteUrlRelationDummy", - "returns": "AbsoluteUrlRelationDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the AbsoluteUrlRelationDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteAbsoluteUrlRelationDummy", - "returns": "owl:Nothing" - } - ], - "id": 2, - "absoluteUrlDummies": [] + "absoluteUrlDummies": [], + "id": 2 } """ @@ -94,46 +56,8 @@ Feature: IRI should contain Absolute URL "@context": "http://example.com/contexts/AbsoluteUrlDummy", "@id": "http://example.com/absolute_url_dummies/1", "@type": "AbsoluteUrlDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a AbsoluteUrlDummy resource.", - "hydra:method": "GET", - "hydra:title": "getAbsoluteUrlDummy", - "returns": "AbsoluteUrlDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "AbsoluteUrlDummy", - "hydra:description": "Replaces the AbsoluteUrlDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putAbsoluteUrlDummy", - "returns": "AbsoluteUrlDummy" - }, - { - "@type": "hydra:Operation", - "expects": "AbsoluteUrlDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the AbsoluteUrlDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchAbsoluteUrlDummy", - "returns": "AbsoluteUrlDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the AbsoluteUrlDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteAbsoluteUrlDummy", - "returns": "owl:Nothing" - } - ], - "id": 1, - "absoluteUrlRelationDummy": "http://example.com/absolute_url_relation_dummies/1" + "absoluteUrlRelationDummy": "http://example.com/absolute_url_relation_dummies/1", + "id": 1 } """ diff --git a/features/jsonld/getter_setter_renaming.feature b/features/jsonld/getter_setter_renaming.feature index 3c52d43a5c..d5f876918b 100644 --- a/features/jsonld/getter_setter_renaming.feature +++ b/features/jsonld/getter_setter_renaming.feature @@ -20,44 +20,6 @@ Feature: Resource should contain one field for each property "@context": "/contexts/EntityWithRenamedGetterAndSetter", "@id": "/entity_with_renamed_getter_and_setters", "@type": "EntityWithRenamedGetterAndSetter", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a EntityWithRenamedGetterAndSetter resource.", - "hydra:method": "GET", - "hydra:title": "getEntityWithRenamedGetterAndSetter", - "returns": "EntityWithRenamedGetterAndSetter" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "EntityWithRenamedGetterAndSetter", - "hydra:description": "Replaces the EntityWithRenamedGetterAndSetter resource.", - "hydra:method": "PUT", - "hydra:title": "putEntityWithRenamedGetterAndSetter", - "returns": "EntityWithRenamedGetterAndSetter" - }, - { - "@type": "hydra:Operation", - "expects": "EntityWithRenamedGetterAndSetter", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the EntityWithRenamedGetterAndSetter resource.", - "hydra:method": "PATCH", - "hydra:title": "patchEntityWithRenamedGetterAndSetter", - "returns": "EntityWithRenamedGetterAndSetter" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the EntityWithRenamedGetterAndSetter resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteEntityWithRenamedGetterAndSetter", - "returns": "owl:Nothing" - } - ], "firstnameOnly": "Sarah" } """ diff --git a/features/jsonld/input_output.feature b/features/jsonld/input_output.feature index cc641ca3ab..121f305006 100644 --- a/features/jsonld/input_output.feature +++ b/features/jsonld/input_output.feature @@ -25,40 +25,9 @@ Feature: JSON-LD DTO input and output "@context": "/contexts/DummyDtoCustom", "@id": "/dummy_dto_customs/1", "@type": "DummyDtoCustom", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a DummyDtoCustom resource.", - "hydra:method": "GET", - "hydra:title": "getDummyDtoCustom", - "returns": "DummyDtoCustom" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "DummyDtoCustom", - "hydra:description": "Replaces the DummyDtoCustom resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyDtoCustom", - "returns": "DummyDtoCustom" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the DummyDtoCustom resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyDtoCustom", - "returns": "owl:Nothing" - }, - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a DummyDtoCustom resource.", - "hydra:method": "GET", - "hydra:title": "getDummyDtoCustom", - "returns": "DummyDtoCustom" - } - ], - "id": 1, "lorem": "test", - "ipsum": "1" + "ipsum": "1", + "id": 1 } """ @@ -284,56 +253,6 @@ Feature: JSON-LD DTO input and output "@context": "/contexts/MessengerWithInput", "@id": "/messenger_with_inputs/1", "@type": "MessengerWithInput", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a MessengerWithInput resource.", - "hydra:method": "GET", - "hydra:title": "getMessengerWithInput", - "returns": "MessengerWithInput" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "MessengerWithInput", - "hydra:description": "Replaces the MessengerWithInput resource.", - "hydra:method": "PUT", - "hydra:title": "putMessengerWithInput", - "returns": "MessengerWithInput" - }, - { - "@type": "hydra:Operation", - "expects": "MessengerWithInput", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the MessengerWithInput resource.", - "hydra:method": "PATCH", - "hydra:title": "patchMessengerWithInput", - "returns": "MessengerWithInput" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the MessengerWithInput resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteMessengerWithInput", - "returns": "owl:Nothing" - } - ], "id": 1, "name": "test" } @@ -374,44 +293,6 @@ Feature: JSON-LD DTO input and output "@context": "/contexts/InitializeInput", "@id": "/initialize_inputs/1", "@type": "InitializeInput", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a InitializeInput resource.", - "hydra:method": "GET", - "hydra:title": "getInitializeInput", - "returns": "InitializeInput" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "InitializeInput", - "hydra:description": "Replaces the InitializeInput resource.", - "hydra:method": "PUT", - "hydra:title": "putInitializeInput", - "returns": "InitializeInput" - }, - { - "@type": "hydra:Operation", - "expects": "InitializeInput", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the InitializeInput resource.", - "hydra:method": "PATCH", - "hydra:title": "patchInitializeInput", - "returns": "InitializeInput" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the InitializeInput resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteInitializeInput", - "returns": "owl:Nothing" - } - ], "id": 1, "manager": "Orwell", "name": "La peste" diff --git a/features/jsonld/interface_as_resource.feature b/features/jsonld/interface_as_resource.feature index 275a751787..7236ace7ae 100644 --- a/features/jsonld/interface_as_resource.feature +++ b/features/jsonld/interface_as_resource.feature @@ -25,44 +25,6 @@ Feature: JSON-LD using interface as resource "@context": "/contexts/Taxon", "@id": "/taxa/WONDERFUL_TAXON", "@type": "Taxon", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Taxon resource.", - "hydra:method": "GET", - "hydra:title": "getTaxon", - "returns": "Taxon" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Taxon", - "hydra:description": "Replaces the Taxon resource.", - "hydra:method": "PUT", - "hydra:title": "putTaxon", - "returns": "Taxon" - }, - { - "@type": "hydra:Operation", - "expects": "Taxon", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Taxon resource.", - "hydra:method": "PATCH", - "hydra:title": "patchTaxon", - "returns": "Taxon" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Taxon resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteTaxon", - "returns": "owl:Nothing" - } - ], "code": "WONDERFUL_TAXON" } """ @@ -85,44 +47,6 @@ Feature: JSON-LD using interface as resource "@context": "/contexts/Product", "@id": "/products/GREAT_PRODUCT", "@type": "Product", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Product resource.", - "hydra:method": "GET", - "hydra:title": "getProduct", - "returns": "Product" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Product", - "hydra:description": "Replaces the Product resource.", - "hydra:method": "PUT", - "hydra:title": "putProduct", - "returns": "Product" - }, - { - "@type": "hydra:Operation", - "expects": "Product", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Product resource.", - "hydra:method": "PATCH", - "hydra:title": "patchProduct", - "returns": "Product" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Product resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteProduct", - "returns": "owl:Nothing" - } - ], "code": "GREAT_PRODUCT", "mainTaxon": { "@id": "/taxa/WONDERFUL_TAXON", diff --git a/features/jsonld/json_serializable.feature b/features/jsonld/json_serializable.feature index 53e09ef34d..57cb57de51 100644 --- a/features/jsonld/json_serializable.feature +++ b/features/jsonld/json_serializable.feature @@ -34,44 +34,6 @@ Feature: JSON-LD using JsonSerializable types "@context": "/contexts/Content", "@id": "/contents/1", "@type": "Content", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Content resource.", - "hydra:method": "GET", - "hydra:title": "getContent", - "returns": "Content" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Content", - "hydra:description": "Replaces the Content resource.", - "hydra:method": "PUT", - "hydra:title": "putContent", - "returns": "Content" - }, - { - "@type": "hydra:Operation", - "expects": "Content", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Content resource.", - "hydra:method": "PATCH", - "hydra:title": "patchContent", - "returns": "Content" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Content resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteContent", - "returns": "owl:Nothing" - } - ], "id": 1, "contentType": "homepage", "status": { @@ -96,44 +58,6 @@ Feature: JSON-LD using JsonSerializable types "@context": "/contexts/Content", "@id": "/contents/1", "@type": "Content", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Content resource.", - "hydra:method": "GET", - "hydra:title": "getContent", - "returns": "Content" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Content", - "hydra:description": "Replaces the Content resource.", - "hydra:method": "PUT", - "hydra:title": "putContent", - "returns": "Content" - }, - { - "@type": "hydra:Operation", - "expects": "Content", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Content resource.", - "hydra:method": "PATCH", - "hydra:title": "patchContent", - "returns": "Content" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Content resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteContent", - "returns": "owl:Nothing" - } - ], "id": 1, "contentType": "homepage", "status": { diff --git a/features/jsonld/network_path.feature b/features/jsonld/network_path.feature index 3fd51f565f..6d486390e3 100644 --- a/features/jsonld/network_path.feature +++ b/features/jsonld/network_path.feature @@ -43,46 +43,8 @@ Feature: IRI should contain network path "@context": "//example.com/contexts/NetworkPathRelationDummy", "@id": "//example.com/network_path_relation_dummies/2", "@type": "NetworkPathRelationDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a NetworkPathRelationDummy resource.", - "hydra:method": "GET", - "hydra:title": "getNetworkPathRelationDummy", - "returns": "NetworkPathRelationDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "NetworkPathRelationDummy", - "hydra:description": "Replaces the NetworkPathRelationDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putNetworkPathRelationDummy", - "returns": "NetworkPathRelationDummy" - }, - { - "@type": "hydra:Operation", - "expects": "NetworkPathRelationDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the NetworkPathRelationDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchNetworkPathRelationDummy", - "returns": "NetworkPathRelationDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the NetworkPathRelationDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteNetworkPathRelationDummy", - "returns": "owl:Nothing" - } - ], - "id": 2, - "networkPathDummies": [] + "networkPathDummies": [], + "id": 2 } """ @@ -96,46 +58,8 @@ Feature: IRI should contain network path "@context": "//example.com/contexts/NetworkPathDummy", "@id": "//example.com/network_path_dummies/1", "@type": "NetworkPathDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a NetworkPathDummy resource.", - "hydra:method": "GET", - "hydra:title": "getNetworkPathDummy", - "returns": "NetworkPathDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "NetworkPathDummy", - "hydra:description": "Replaces the NetworkPathDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putNetworkPathDummy", - "returns": "NetworkPathDummy" - }, - { - "@type": "hydra:Operation", - "expects": "NetworkPathDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the NetworkPathDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchNetworkPathDummy", - "returns": "NetworkPathDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the NetworkPathDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteNetworkPathDummy", - "returns": "owl:Nothing" - } - ], - "id": 1, - "networkPathRelationDummy": "//example.com/network_path_relation_dummies/1" + "networkPathRelationDummy": "//example.com/network_path_relation_dummies/1", + "id": 1 } """ diff --git a/features/main/attribute_resource.feature b/features/main/attribute_resource.feature index abc5949df8..da92073e98 100644 --- a/features/main/attribute_resource.feature +++ b/features/main/attribute_resource.feature @@ -48,39 +48,6 @@ Feature: Resource attributes "@context": "/contexts/AttributeResource", "@id": "/attribute_resources/1", "@type": "AttributeResource", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a AttributeResource resource.", - "hydra:method": "GET", - "hydra:title": "getAttributeResource", - "returns": "AttributeResource" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "AttributeResource", - "hydra:description": "Replaces the AttributeResource resource.", - "hydra:method": "PUT", - "hydra:title": "putAttributeResource", - "returns": "AttributeResource" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the AttributeResource resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteAttributeResource", - "returns": "owl:Nothing" - } - ], "identifier": 1, "name": "Foo" } @@ -99,39 +66,6 @@ Feature: Resource attributes "@context": "/contexts/AttributeResource", "@id": "/attribute_resources/2", "@type": "AttributeResource", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a AttributeResource resource.", - "hydra:method": "GET", - "hydra:title": "getAttributeResource", - "returns": "AttributeResource" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "AttributeResource", - "hydra:description": "Replaces the AttributeResource resource.", - "hydra:method": "PUT", - "hydra:title": "putAttributeResource", - "returns": "AttributeResource" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the AttributeResource resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteAttributeResource", - "returns": "owl:Nothing" - } - ], "identifier": 2, "dummy": "/dummies/1", "name": "Foo" @@ -154,39 +88,6 @@ Feature: Resource attributes "@context": "/contexts/AttributeResource", "@id": "/attribute_resources/2", "@type": "AttributeResource", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a AttributeResource resource.", - "hydra:method": "GET", - "hydra:title": "getAttributeResource", - "returns": "AttributeResource" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "AttributeResource", - "hydra:description": "Replaces the AttributeResource resource.", - "hydra:method": "PUT", - "hydra:title": "putAttributeResource", - "returns": "AttributeResource" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the AttributeResource resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteAttributeResource", - "returns": "owl:Nothing" - } - ], "identifier": 2, "dummy": "/dummies/1", "name": "Patched" diff --git a/features/main/circular_reference.feature b/features/main/circular_reference.feature index 41d477bf6a..f53d44d916 100644 --- a/features/main/circular_reference.feature +++ b/features/main/circular_reference.feature @@ -26,44 +26,6 @@ Feature: Circular references handling "@context": "/contexts/CircularReference", "@id": "/circular_references/1", "@type": "CircularReference", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a CircularReference resource.", - "hydra:method": "GET", - "hydra:title": "getCircularReference", - "returns": "CircularReference" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "CircularReference", - "hydra:description": "Replaces the CircularReference resource.", - "hydra:method": "PUT", - "hydra:title": "putCircularReference", - "returns": "CircularReference" - }, - { - "@type": "hydra:Operation", - "expects": "CircularReference", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the CircularReference resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCircularReference", - "returns": "CircularReference" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the CircularReference resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCircularReference", - "returns": "owl:Nothing" - } - ], "parent": "/circular_references/1", "children": [ "/circular_references/1" @@ -93,44 +55,6 @@ Feature: Circular references handling "@context": "/contexts/CircularReference", "@id": "/circular_references/2", "@type": "CircularReference", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a CircularReference resource.", - "hydra:method": "GET", - "hydra:title": "getCircularReference", - "returns": "CircularReference" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "CircularReference", - "hydra:description": "Replaces the CircularReference resource.", - "hydra:method": "PUT", - "hydra:title": "putCircularReference", - "returns": "CircularReference" - }, - { - "@type": "hydra:Operation", - "expects": "CircularReference", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the CircularReference resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCircularReference", - "returns": "CircularReference" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the CircularReference resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCircularReference", - "returns": "owl:Nothing" - } - ], "parent": { "@id": "/circular_references/1", "@type": "CircularReference", @@ -151,44 +75,6 @@ Feature: Circular references handling "@context": "/contexts/CircularReference", "@id": "/circular_references/1", "@type": "CircularReference", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a CircularReference resource.", - "hydra:method": "GET", - "hydra:title": "getCircularReference", - "returns": "CircularReference" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "CircularReference", - "hydra:description": "Replaces the CircularReference resource.", - "hydra:method": "PUT", - "hydra:title": "putCircularReference", - "returns": "CircularReference" - }, - { - "@type": "hydra:Operation", - "expects": "CircularReference", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the CircularReference resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCircularReference", - "returns": "CircularReference" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the CircularReference resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCircularReference", - "returns": "owl:Nothing" - } - ], "parent": "/circular_references/1", "children": [ "/circular_references/1", diff --git a/features/main/composite.feature b/features/main/composite.feature index ce99918955..ab99527bd7 100644 --- a/features/main/composite.feature +++ b/features/main/composite.feature @@ -95,56 +95,6 @@ Feature: Retrieve data with Composite identifiers "@context": "/contexts/CompositeRelation", "@id": "/composite_relations/compositeItem=1;compositeLabel=1", "@type": "CompositeRelation", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CompositeRelation resource.", - "hydra:method": "GET", - "hydra:title": "getCompositeRelation", - "returns": "CompositeRelation" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "CompositeRelation", - "hydra:description": "Replaces the CompositeRelation resource.", - "hydra:method": "PUT", - "hydra:title": "putCompositeRelation", - "returns": "CompositeRelation" - }, - { - "@type": "hydra:Operation", - "expects": "CompositeRelation", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the CompositeRelation resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCompositeRelation", - "returns": "CompositeRelation" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the CompositeRelation resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCompositeRelation", - "returns": "owl:Nothing" - } - ], "value": "somefoobardummy", "compositeItem": "/composite_items/1", "compositeLabel": "/composite_labels/1" @@ -164,56 +114,6 @@ Feature: Retrieve data with Composite identifiers "@context": "/contexts/CompositeRelation", "@id": "/composite_relations/compositeItem=1;compositeLabel=1", "@type": "CompositeRelation", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CompositeRelation resource.", - "hydra:method": "GET", - "hydra:title": "getCompositeRelation", - "returns": "CompositeRelation" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "CompositeRelation", - "hydra:description": "Replaces the CompositeRelation resource.", - "hydra:method": "PUT", - "hydra:title": "putCompositeRelation", - "returns": "CompositeRelation" - }, - { - "@type": "hydra:Operation", - "expects": "CompositeRelation", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the CompositeRelation resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCompositeRelation", - "returns": "CompositeRelation" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the CompositeRelation resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCompositeRelation", - "returns": "owl:Nothing" - } - ], "value": "somefoobardummy", "compositeItem": "/composite_items/1", "compositeLabel": "/composite_labels/1" diff --git a/features/main/configurable.feature b/features/main/configurable.feature index e3f6fc9439..c0e73d1ba2 100644 --- a/features/main/configurable.feature +++ b/features/main/configurable.feature @@ -55,44 +55,6 @@ Feature: Configurable resource CRUD "@context": "/contexts/fileconfigdummy", "@id": "/fileconfigdummies/1", "@type": "fileconfigdummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a fileconfigdummy resource.", - "hydra:method": "GET", - "hydra:title": "getfileconfigdummy", - "returns": "fileconfigdummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "fileconfigdummy", - "hydra:description": "Replaces the fileconfigdummy resource.", - "hydra:method": "PUT", - "hydra:title": "putfileconfigdummy", - "returns": "fileconfigdummy" - }, - { - "@type": "hydra:Operation", - "expects": "fileconfigdummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the fileconfigdummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchfileconfigdummy", - "returns": "fileconfigdummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the fileconfigdummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deletefileconfigdummy", - "returns": "owl:Nothing" - } - ], "id": 1, "name": "ConfigDummy", "foo": "Foo" diff --git a/features/main/crud.feature b/features/main/crud.feature index 6673d6ee25..5933812bcc 100644 --- a/features/main/crud.feature +++ b/features/main/crud.feature @@ -30,44 +30,6 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/Dummy", "@id": "/dummies/1", "@type": "Dummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Dummy resource.", - "hydra:method": "GET", - "hydra:title": "getDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Dummy", - "hydra:description": "Replaces the Dummy resource.", - "hydra:method": "PUT", - "hydra:title": "putDummy", - "returns": "Dummy" - }, - { - "@type": "hydra:Operation", - "expects": "Dummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Dummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Dummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummy", - "returns": "owl:Nothing" - } - ], "description": null, "dummy": null, "dummyBoolean": null, @@ -105,44 +67,6 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/Dummy", "@id": "/dummies/1", "@type": "Dummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Dummy resource.", - "hydra:method": "GET", - "hydra:title": "getDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Dummy", - "hydra:description": "Replaces the Dummy resource.", - "hydra:method": "PUT", - "hydra:title": "putDummy", - "returns": "Dummy" - }, - { - "@type": "hydra:Operation", - "expects": "Dummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Dummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Dummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummy", - "returns": "owl:Nothing" - } - ], "description": null, "dummy": null, "dummyBoolean": null, @@ -599,44 +523,6 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/Dummy", "@id": "/dummies/1", "@type": "Dummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Dummy resource.", - "hydra:method": "GET", - "hydra:title": "getDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Dummy", - "hydra:description": "Replaces the Dummy resource.", - "hydra:method": "PUT", - "hydra:title": "putDummy", - "returns": "Dummy" - }, - { - "@type": "hydra:Operation", - "expects": "Dummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Dummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Dummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummy", - "returns": "owl:Nothing" - } - ], "description": null, "dummy": null, "dummyBoolean": null, @@ -696,15 +582,6 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/ProcessorEntity", "@id": "/processor_entities/1", "@type": "ProcessorEntity", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a ProcessorEntity resource.", - "hydra:method": "GET", - "hydra:title": "getProcessorEntity", - "returns": "ProcessorEntity" - } - ], "id": 1, "foo": "bar" } @@ -730,15 +607,6 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/ProviderEntity", "@id": "/provider_entities/1", "@type": "ProviderEntity", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a ProviderEntity resource.", - "hydra:method": "GET", - "hydra:title": "getProviderEntity", - "returns": "ProviderEntity" - } - ], "id": 1, "foo": "bar" } @@ -782,15 +650,6 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/ProviderEntity", "@id": "/provider_entities/1", "@type": "ProviderEntity", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a ProviderEntity resource.", - "hydra:method": "GET", - "hydra:title": "getProviderEntity", - "returns": "ProviderEntity" - } - ], "id": 1, "foo": "bar" } @@ -809,44 +668,6 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/Program", "@id": "/programs/1", "@type": "Program", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Program resource.", - "hydra:method": "GET", - "hydra:title": "getProgram", - "returns": "Program" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Program", - "hydra:description": "Replaces the Program resource.", - "hydra:method": "PUT", - "hydra:title": "putProgram", - "returns": "Program" - }, - { - "@type": "hydra:Operation", - "expects": "Program", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Program resource.", - "hydra:method": "PATCH", - "hydra:title": "patchProgram", - "returns": "Program" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Program resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteProgram", - "returns": "owl:Nothing" - } - ], "id": 1, "name": "Lorem ipsum 1", "date": "2015-03-01T10:00:00+00:00", @@ -910,44 +731,6 @@ Feature: Create-Retrieve-Update-Delete "@context": "/contexts/Comment", "@id": "/comments/1", "@type": "Comment", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Comment resource.", - "hydra:method": "GET", - "hydra:title": "getComment", - "returns": "Comment" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Comment", - "hydra:description": "Replaces the Comment resource.", - "hydra:method": "PUT", - "hydra:title": "putComment", - "returns": "Comment" - }, - { - "@type": "hydra:Operation", - "expects": "Comment", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Comment resource.", - "hydra:method": "PATCH", - "hydra:title": "patchComment", - "returns": "Comment" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Comment resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteComment", - "returns": "owl:Nothing" - } - ], "id": 1, "comment": "Lorem ipsum dolor sit amet 1", "date": "2015-03-01T10:00:00+00:00", diff --git a/features/main/crud_abstract.feature b/features/main/crud_abstract.feature index 93ea2aa3f6..fc8bd66c69 100644 --- a/features/main/crud_abstract.feature +++ b/features/main/crud_abstract.feature @@ -24,56 +24,6 @@ Feature: Create-Retrieve-Update-Delete on abstract resource "@context": "/contexts/ConcreteDummy", "@id": "/concrete_dummies/1", "@type": "ConcreteDummy", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a ConcreteDummy resource.", - "hydra:method": "GET", - "hydra:title": "getConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "ConcreteDummy", - "hydra:description": "Replaces the ConcreteDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": "hydra:Operation", - "expects": "ConcreteDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the ConcreteDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the ConcreteDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteConcreteDummy", - "returns": "owl:Nothing" - } - ], "instance": "Concrete", "id": 1, "name": "My Dummy" @@ -92,56 +42,6 @@ Feature: Create-Retrieve-Update-Delete on abstract resource "@context": "/contexts/ConcreteDummy", "@id": "/concrete_dummies/1", "@type": "ConcreteDummy", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a ConcreteDummy resource.", - "hydra:method": "GET", - "hydra:title": "getConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "ConcreteDummy", - "hydra:description": "Replaces the ConcreteDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": "hydra:Operation", - "expects": "ConcreteDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the ConcreteDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the ConcreteDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteConcreteDummy", - "returns": "owl:Nothing" - } - ], "instance": "Concrete", "id": 1, "name": "My Dummy" @@ -201,56 +101,6 @@ Feature: Create-Retrieve-Update-Delete on abstract resource "@context": "/contexts/ConcreteDummy", "@id": "/concrete_dummies/1", "@type": "ConcreteDummy", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a ConcreteDummy resource.", - "hydra:method": "GET", - "hydra:title": "getConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "ConcreteDummy", - "hydra:description": "Replaces the ConcreteDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": "hydra:Operation", - "expects": "ConcreteDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the ConcreteDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the ConcreteDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteConcreteDummy", - "returns": "owl:Nothing" - } - ], "instance": "Become real", "id": 1, "name": "A nice dummy" @@ -277,56 +127,6 @@ Feature: Create-Retrieve-Update-Delete on abstract resource "@context": "/contexts/ConcreteDummy", "@id": "/concrete_dummies/1", "@type": "ConcreteDummy", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a ConcreteDummy resource.", - "hydra:method": "GET", - "hydra:title": "getConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "ConcreteDummy", - "hydra:description": "Replaces the ConcreteDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": "hydra:Operation", - "expects": "ConcreteDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the ConcreteDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the ConcreteDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteConcreteDummy", - "returns": "owl:Nothing" - } - ], "instance": "Become surreal", "id": 1, "name": "A nicer dummy" @@ -360,56 +160,6 @@ Feature: Create-Retrieve-Update-Delete on abstract resource "@context": "/contexts/ConcreteDummy", "@id": "/concrete_dummies/1", "@type": "ConcreteDummy", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a ConcreteDummy resource.", - "hydra:method": "GET", - "hydra:title": "getConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "ConcreteDummy", - "hydra:description": "Replaces the ConcreteDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": "hydra:Operation", - "expects": "ConcreteDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the ConcreteDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchConcreteDummy", - "returns": "ConcreteDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the ConcreteDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteConcreteDummy", - "returns": "owl:Nothing" - } - ], "instance": "Concrete", "id": 1, "name": "My Dummy" diff --git a/features/main/crud_uri_variables.feature b/features/main/crud_uri_variables.feature index 9ea43e3e0b..37787dc56d 100644 --- a/features/main/crud_uri_variables.feature +++ b/features/main/crud_uri_variables.feature @@ -21,31 +21,9 @@ Feature: Uri Variables "@context": "/contexts/Company", "@id": "/companies/1", "@type": "Company", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a Company resource.", - "hydra:method": "GET", - "hydra:title": "getCompany", - "returns": "Company" - }, - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a Company resource.", - "hydra:method": "GET", - "hydra:title": "getCompany", - "returns": "owl:Nothing" - } - ], "id": 1, "name": "Foo Company 1", - "employees": [] + "employees": null } """ @@ -194,31 +172,9 @@ Feature: Uri Variables "@context": "/contexts/Company", "@id": "/employees/1/company", "@type": "Company", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a Company resource.", - "hydra:method": "GET", - "hydra:title": "getCompany", - "returns": "Company" - }, - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a Company resource.", - "hydra:method": "GET", - "hydra:title": "getCompany", - "returns": "owl:Nothing" - } - ], "id": 1, "name": "Foo Company 1", - "employees": [] + "employees": null } """ diff --git a/features/main/custom_controller.feature b/features/main/custom_controller.feature index 64669d6fe0..16516099e5 100644 --- a/features/main/custom_controller.feature +++ b/features/main/custom_controller.feature @@ -16,48 +16,6 @@ Feature: Custom operation "@context": "/contexts/CustomActionDummy", "@id": "/custom_action_dummies/1", "@type": "CustomActionDummy", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomActionDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomActionDummy", - "returns": "CustomActionDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomActionDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomActionDummy", - "returns": "CustomActionDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomActionDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomActionDummy", - "returns": "CustomActionDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomActionDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomActionDummy", - "returns": "CustomActionDummy" - } - ], "id": 1, "foo": "custom!" } @@ -81,48 +39,6 @@ Feature: Custom operation "@context": "/contexts/CustomActionDummy", "@id": "/custom_action_dummies/2", "@type": "CustomActionDummy", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomActionDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomActionDummy", - "returns": "CustomActionDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomActionDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomActionDummy", - "returns": "CustomActionDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomActionDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomActionDummy", - "returns": "CustomActionDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomActionDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomActionDummy", - "returns": "CustomActionDummy" - } - ], "id": 2, "foo": "short declaration" } @@ -151,48 +67,6 @@ Feature: Custom operation "@context": "/contexts/CustomActionDummy", "@id": "/custom_action_collection_dummies/1", "@type": "CustomActionDummy", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomActionDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomActionDummy", - "returns": "CustomActionDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomActionDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomActionDummy", - "returns": "CustomActionDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomActionDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomActionDummy", - "returns": "CustomActionDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomActionDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomActionDummy", - "returns": "CustomActionDummy" - } - ], "id": 1, "foo": "custom!" } @@ -215,21 +89,9 @@ Feature: Custom operation "@context": "/contexts/Payment", "@id": "/payments/1", "@type": "Payment", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a Payment resource.", - "hydra:method": "GET", - "hydra:title": "getPayment", - "returns": "Payment" - } - ], "id": 1, - "voidPayment": null, - "amount": "123.45" + "amount": "123.45", + "voidPayment": null } """ @@ -246,59 +108,9 @@ Feature: Custom operation "@context": "/contexts/VoidPayment", "@id": "/void_payments/1", "@type": "VoidPayment", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a VoidPayment resource.", - "hydra:method": "GET", - "hydra:title": "getVoidPayment", - "returns": "VoidPayment" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "VoidPayment", - "hydra:description": "Replaces the VoidPayment resource.", - "hydra:method": "PUT", - "hydra:title": "putVoidPayment", - "returns": "VoidPayment" - }, - { - "@type": "hydra:Operation", - "expects": "VoidPayment", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the VoidPayment resource.", - "hydra:method": "PATCH", - "hydra:title": "patchVoidPayment", - "returns": "VoidPayment" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the VoidPayment resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteVoidPayment", - "returns": "owl:Nothing" - } - ], "id": 1, "payment": "/payments/1" - } + } """ Scenario: Get a void payment @@ -312,57 +124,7 @@ Feature: Custom operation "@context": "/contexts/VoidPayment", "@id": "/void_payments/1", "@type": "VoidPayment", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a VoidPayment resource.", - "hydra:method": "GET", - "hydra:title": "getVoidPayment", - "returns": "VoidPayment" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "VoidPayment", - "hydra:description": "Replaces the VoidPayment resource.", - "hydra:method": "PUT", - "hydra:title": "putVoidPayment", - "returns": "VoidPayment" - }, - { - "@type": "hydra:Operation", - "expects": "VoidPayment", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the VoidPayment resource.", - "hydra:method": "PATCH", - "hydra:title": "patchVoidPayment", - "returns": "VoidPayment" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the VoidPayment resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteVoidPayment", - "returns": "owl:Nothing" - } - ], "id": 1, "payment": "/payments/1" - } + } """ diff --git a/features/main/custom_identifier.feature b/features/main/custom_identifier.feature index 225bf55e8e..4af0178730 100644 --- a/features/main/custom_identifier.feature +++ b/features/main/custom_identifier.feature @@ -21,56 +21,6 @@ Feature: Using custom identifier on resource "@context": "/contexts/CustomIdentifierDummy", "@id": "/custom_identifier_dummies/1", "@type": "CustomIdentifierDummy", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomIdentifierDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomIdentifierDummy", - "returns": "CustomIdentifierDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "CustomIdentifierDummy", - "hydra:description": "Replaces the CustomIdentifierDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putCustomIdentifierDummy", - "returns": "CustomIdentifierDummy" - }, - { - "@type": "hydra:Operation", - "expects": "CustomIdentifierDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the CustomIdentifierDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCustomIdentifierDummy", - "returns": "CustomIdentifierDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the CustomIdentifierDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCustomIdentifierDummy", - "returns": "owl:Nothing" - } - ], "customId": 1, "name": "My Dummy" } @@ -87,56 +37,6 @@ Feature: Using custom identifier on resource "@context": "/contexts/CustomIdentifierDummy", "@id": "/custom_identifier_dummies/1", "@type": "CustomIdentifierDummy", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomIdentifierDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomIdentifierDummy", - "returns": "CustomIdentifierDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "CustomIdentifierDummy", - "hydra:description": "Replaces the CustomIdentifierDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putCustomIdentifierDummy", - "returns": "CustomIdentifierDummy" - }, - { - "@type": "hydra:Operation", - "expects": "CustomIdentifierDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the CustomIdentifierDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCustomIdentifierDummy", - "returns": "CustomIdentifierDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the CustomIdentifierDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCustomIdentifierDummy", - "returns": "owl:Nothing" - } - ], "customId": 1, "name": "My Dummy" } @@ -182,56 +82,6 @@ Feature: Using custom identifier on resource "@context": "/contexts/CustomIdentifierDummy", "@id": "/custom_identifier_dummies/1", "@type": "CustomIdentifierDummy", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomIdentifierDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomIdentifierDummy", - "returns": "CustomIdentifierDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "CustomIdentifierDummy", - "hydra:description": "Replaces the CustomIdentifierDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putCustomIdentifierDummy", - "returns": "CustomIdentifierDummy" - }, - { - "@type": "hydra:Operation", - "expects": "CustomIdentifierDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the CustomIdentifierDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCustomIdentifierDummy", - "returns": "CustomIdentifierDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the CustomIdentifierDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCustomIdentifierDummy", - "returns": "owl:Nothing" - } - ], "customId": 1, "name": "My Dummy modified" } @@ -264,44 +114,6 @@ Feature: Using custom identifier on resource "@context": "/contexts/CustomMultipleIdentifierDummy", "@id": "/custom_multiple_identifier_dummies/1/2", "@type": "CustomMultipleIdentifierDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a CustomMultipleIdentifierDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomMultipleIdentifierDummy", - "returns": "CustomMultipleIdentifierDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "CustomMultipleIdentifierDummy", - "hydra:description": "Replaces the CustomMultipleIdentifierDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putCustomMultipleIdentifierDummy", - "returns": "CustomMultipleIdentifierDummy" - }, - { - "@type": "hydra:Operation", - "expects": "CustomMultipleIdentifierDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the CustomMultipleIdentifierDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCustomMultipleIdentifierDummy", - "returns": "CustomMultipleIdentifierDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the CustomMultipleIdentifierDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCustomMultipleIdentifierDummy", - "returns": "owl:Nothing" - } - ], "firstId": 1, "secondId": 2, "name": "Orwell" diff --git a/features/main/custom_identifier_with_subresource.feature b/features/main/custom_identifier_with_subresource.feature index 4e0817e6f1..74d9c65a4c 100644 --- a/features/main/custom_identifier_with_subresource.feature +++ b/features/main/custom_identifier_with_subresource.feature @@ -21,44 +21,6 @@ Feature: Using custom parent identifier for resources "@context": "/contexts/SlugParentDummy", "@id": "/slug_parent_dummies/parent-dummy", "@type": "SlugParentDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a SlugParentDummy resource.", - "hydra:method": "GET", - "hydra:title": "getSlugParentDummy", - "returns": "SlugParentDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "SlugParentDummy", - "hydra:description": "Replaces the SlugParentDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putSlugParentDummy", - "returns": "SlugParentDummy" - }, - { - "@type": "hydra:Operation", - "expects": "SlugParentDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the SlugParentDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchSlugParentDummy", - "returns": "SlugParentDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the SlugParentDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteSlugParentDummy", - "returns": "owl:Nothing" - } - ], "id": 1, "slug": "parent-dummy", "childDummies": [] @@ -83,44 +45,6 @@ Feature: Using custom parent identifier for resources "@context": "/contexts/SlugChildDummy", "@id": "/slug_child_dummies/child-dummy", "@type": "SlugChildDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a SlugChildDummy resource.", - "hydra:method": "GET", - "hydra:title": "getSlugChildDummy", - "returns": "SlugChildDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "SlugChildDummy", - "hydra:description": "Replaces the SlugChildDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putSlugChildDummy", - "returns": "SlugChildDummy" - }, - { - "@type": "hydra:Operation", - "expects": "SlugChildDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the SlugChildDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchSlugChildDummy", - "returns": "SlugChildDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the SlugChildDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteSlugChildDummy", - "returns": "owl:Nothing" - } - ], "id": 1, "slug": "child-dummy", "parentDummy": "/slug_parent_dummies/parent-dummy" @@ -162,44 +86,6 @@ Feature: Using custom parent identifier for resources "@context": "/contexts/SlugParentDummy", "@id": "/slug_child_dummies/child-dummy/parent_dummy", "@type": "SlugParentDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a SlugParentDummy resource.", - "hydra:method": "GET", - "hydra:title": "getSlugParentDummy", - "returns": "SlugParentDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "SlugParentDummy", - "hydra:description": "Replaces the SlugParentDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putSlugParentDummy", - "returns": "SlugParentDummy" - }, - { - "@type": "hydra:Operation", - "expects": "SlugParentDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the SlugParentDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchSlugParentDummy", - "returns": "SlugParentDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the SlugParentDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteSlugParentDummy", - "returns": "owl:Nothing" - } - ], "id": 1, "slug": "parent-dummy", "childDummies": [ diff --git a/features/main/custom_normalized.feature b/features/main/custom_normalized.feature index 0bb23a8ff1..7d1a49f3fe 100644 --- a/features/main/custom_normalized.feature +++ b/features/main/custom_normalized.feature @@ -24,44 +24,6 @@ Feature: Using custom normalized entity "@context": "/contexts/CustomNormalizedDummy", "@id": "/custom_normalized_dummies/1", "@type": "CustomNormalizedDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a CustomNormalizedDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomNormalizedDummy", - "returns": "CustomNormalizedDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "CustomNormalizedDummy", - "hydra:description": "Replaces the CustomNormalizedDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putCustomNormalizedDummy", - "returns": "CustomNormalizedDummy" - }, - { - "@type": "hydra:Operation", - "expects": "CustomNormalizedDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the CustomNormalizedDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCustomNormalizedDummy", - "returns": "CustomNormalizedDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the CustomNormalizedDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCustomNormalizedDummy", - "returns": "owl:Nothing" - } - ], "id": 1, "name": "My Dummy", "alias": "My alias" @@ -155,44 +117,6 @@ Feature: Using custom normalized entity "@context": "/contexts/CustomNormalizedDummy", "@id": "/custom_normalized_dummies/1", "@type": "CustomNormalizedDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a CustomNormalizedDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomNormalizedDummy", - "returns": "CustomNormalizedDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "CustomNormalizedDummy", - "hydra:description": "Replaces the CustomNormalizedDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putCustomNormalizedDummy", - "returns": "CustomNormalizedDummy" - }, - { - "@type": "hydra:Operation", - "expects": "CustomNormalizedDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the CustomNormalizedDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCustomNormalizedDummy", - "returns": "CustomNormalizedDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the CustomNormalizedDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCustomNormalizedDummy", - "returns": "owl:Nothing" - } - ], "id": 1, "name": "My Dummy", "alias": "My alias" @@ -241,44 +165,6 @@ Feature: Using custom normalized entity "@context": "/contexts/CustomNormalizedDummy", "@id": "/custom_normalized_dummies/1", "@type": "CustomNormalizedDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a CustomNormalizedDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomNormalizedDummy", - "returns": "CustomNormalizedDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "CustomNormalizedDummy", - "hydra:description": "Replaces the CustomNormalizedDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putCustomNormalizedDummy", - "returns": "CustomNormalizedDummy" - }, - { - "@type": "hydra:Operation", - "expects": "CustomNormalizedDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the CustomNormalizedDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCustomNormalizedDummy", - "returns": "CustomNormalizedDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the CustomNormalizedDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCustomNormalizedDummy", - "returns": "owl:Nothing" - } - ], "id": 1, "name": "My Dummy modified", "alias": "My alias" @@ -303,44 +189,6 @@ Feature: Using custom normalized entity "@context": "/contexts/CustomNormalizedDummy", "@id": "/custom_normalized_dummies/1", "@type": "CustomNormalizedDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a CustomNormalizedDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomNormalizedDummy", - "returns": "CustomNormalizedDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "CustomNormalizedDummy", - "hydra:description": "Replaces the CustomNormalizedDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putCustomNormalizedDummy", - "returns": "CustomNormalizedDummy" - }, - { - "@type": "hydra:Operation", - "expects": "CustomNormalizedDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the CustomNormalizedDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCustomNormalizedDummy", - "returns": "CustomNormalizedDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the CustomNormalizedDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCustomNormalizedDummy", - "returns": "owl:Nothing" - } - ], "id": 1, "name": "My Dummy modified", "alias": "My alias" diff --git a/features/main/custom_put.feature b/features/main/custom_put.feature index ccbe2dfc9c..9b286b57cb 100644 --- a/features/main/custom_put.feature +++ b/features/main/custom_put.feature @@ -22,29 +22,6 @@ Feature: Spec-compliant PUT support "@context": "/contexts/CustomPut", "@id": "/custom_puts/1", "@type": "CustomPut", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomPut resource.", - "hydra:method": "GET", - "hydra:title": "getCustomPut", - "returns": "CustomPut" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "CustomPut", - "hydra:description": "Replaces the CustomPut resource.", - "hydra:method": "PUT", - "hydra:title": "putCustomPut", - "returns": "CustomPut" - } - ], "id": 1, "foo": "a", "bar": "b" diff --git a/features/main/custom_writable_identifier.feature b/features/main/custom_writable_identifier.feature index 430709db9d..097d253b9a 100644 --- a/features/main/custom_writable_identifier.feature +++ b/features/main/custom_writable_identifier.feature @@ -24,44 +24,6 @@ Feature: Using custom writable identifier on resource "@context": "/contexts/CustomWritableIdentifierDummy", "@id": "/custom_writable_identifier_dummies/my_slug", "@type": "CustomWritableIdentifierDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a CustomWritableIdentifierDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomWritableIdentifierDummy", - "returns": "CustomWritableIdentifierDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "CustomWritableIdentifierDummy", - "hydra:description": "Replaces the CustomWritableIdentifierDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putCustomWritableIdentifierDummy", - "returns": "CustomWritableIdentifierDummy" - }, - { - "@type": "hydra:Operation", - "expects": "CustomWritableIdentifierDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the CustomWritableIdentifierDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCustomWritableIdentifierDummy", - "returns": "CustomWritableIdentifierDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the CustomWritableIdentifierDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCustomWritableIdentifierDummy", - "returns": "owl:Nothing" - } - ], "slug": "my_slug", "name": "My Dummy" } @@ -78,44 +40,6 @@ Feature: Using custom writable identifier on resource "@context": "/contexts/CustomWritableIdentifierDummy", "@id": "/custom_writable_identifier_dummies/my_slug", "@type": "CustomWritableIdentifierDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a CustomWritableIdentifierDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomWritableIdentifierDummy", - "returns": "CustomWritableIdentifierDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "CustomWritableIdentifierDummy", - "hydra:description": "Replaces the CustomWritableIdentifierDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putCustomWritableIdentifierDummy", - "returns": "CustomWritableIdentifierDummy" - }, - { - "@type": "hydra:Operation", - "expects": "CustomWritableIdentifierDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the CustomWritableIdentifierDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCustomWritableIdentifierDummy", - "returns": "CustomWritableIdentifierDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the CustomWritableIdentifierDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCustomWritableIdentifierDummy", - "returns": "owl:Nothing" - } - ], "slug": "my_slug", "name": "My Dummy" } @@ -164,56 +88,6 @@ Feature: Using custom writable identifier on resource "@context": "/contexts/CustomWritableIdentifierDummy", "@id": "/custom_writable_identifier_dummies/slug_modified", "@type": "CustomWritableIdentifierDummy", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a CustomWritableIdentifierDummy resource.", - "hydra:method": "GET", - "hydra:title": "getCustomWritableIdentifierDummy", - "returns": "CustomWritableIdentifierDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "CustomWritableIdentifierDummy", - "hydra:description": "Replaces the CustomWritableIdentifierDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putCustomWritableIdentifierDummy", - "returns": "CustomWritableIdentifierDummy" - }, - { - "@type": "hydra:Operation", - "expects": "CustomWritableIdentifierDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the CustomWritableIdentifierDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCustomWritableIdentifierDummy", - "returns": "CustomWritableIdentifierDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the CustomWritableIdentifierDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCustomWritableIdentifierDummy", - "returns": "owl:Nothing" - } - ], "slug": "slug_modified", "name": "My Dummy modified" } diff --git a/features/main/exposed_state.feature b/features/main/exposed_state.feature index 5b29044bf8..1915732f38 100644 --- a/features/main/exposed_state.feature +++ b/features/main/exposed_state.feature @@ -21,58 +21,8 @@ Feature: Expose persisted object state "@context": "/contexts/TruncatedDummy", "@id": "/truncated_dummies/1", "@type": "TruncatedDummy", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a TruncatedDummy resource.", - "hydra:method": "GET", - "hydra:title": "getTruncatedDummy", - "returns": "TruncatedDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "TruncatedDummy", - "hydra:description": "Replaces the TruncatedDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putTruncatedDummy", - "returns": "TruncatedDummy" - }, - { - "@type": "hydra:Operation", - "expects": "TruncatedDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the TruncatedDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchTruncatedDummy", - "returns": "TruncatedDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the TruncatedDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteTruncatedDummy", - "returns": "owl:Nothing" - } - ], - "id": 1, - "value": "20.3" + "value": "20.3", + "id": 1 } """ @@ -92,57 +42,7 @@ Feature: Expose persisted object state "@context": "/contexts/TruncatedDummy", "@id": "/truncated_dummies/1", "@type": "TruncatedDummy", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a TruncatedDummy resource.", - "hydra:method": "GET", - "hydra:title": "getTruncatedDummy", - "returns": "TruncatedDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "TruncatedDummy", - "hydra:description": "Replaces the TruncatedDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putTruncatedDummy", - "returns": "TruncatedDummy" - }, - { - "@type": "hydra:Operation", - "expects": "TruncatedDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the TruncatedDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchTruncatedDummy", - "returns": "TruncatedDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the TruncatedDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteTruncatedDummy", - "returns": "owl:Nothing" - } - ], - "id": 1, - "value": "42.4" + "value": "42.4", + "id": 1 } """ diff --git a/features/main/operation.feature b/features/main/operation.feature index 81ad8674bf..24a82890cf 100644 --- a/features/main/operation.feature +++ b/features/main/operation.feature @@ -21,44 +21,6 @@ Feature: Operation support "@context": "/contexts/ReadableOnlyProperty", "@id": "/readable_only_properties/1", "@type": "ReadableOnlyProperty", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a ReadableOnlyProperty resource.", - "hydra:method": "GET", - "hydra:title": "getReadableOnlyProperty", - "returns": "ReadableOnlyProperty" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "ReadableOnlyProperty", - "hydra:description": "Replaces the ReadableOnlyProperty resource.", - "hydra:method": "PUT", - "hydra:title": "putReadableOnlyProperty", - "returns": "ReadableOnlyProperty" - }, - { - "@type": "hydra:Operation", - "expects": "ReadableOnlyProperty", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the ReadableOnlyProperty resource.", - "hydra:method": "PATCH", - "hydra:title": "patchReadableOnlyProperty", - "returns": "ReadableOnlyProperty" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the ReadableOnlyProperty resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteReadableOnlyProperty", - "returns": "owl:Nothing" - } - ], "id": 1, "name": "Read only" } @@ -116,22 +78,6 @@ Feature: Operation support "@context": "/contexts/Book", "@id": "/books/by_isbn/9780451524935", "@type": "Book", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Book resource.", - "hydra:method": "GET", - "hydra:title": "getBook", - "returns": "Book" - }, - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Book resource.", - "hydra:method": "GET", - "hydra:title": "getBook", - "returns": "Book" - } - ], "name": "1984", "isbn": "9780451524935", "id": 1 diff --git a/features/main/operation_resource.feature b/features/main/operation_resource.feature index 180fa3ef08..b4bd729fca 100644 --- a/features/main/operation_resource.feature +++ b/features/main/operation_resource.feature @@ -35,55 +35,6 @@ Feature: Resource operations "@context": "/contexts/OperationResource", "@id": "/operation_resources/1", "@type": "OperationResource", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a OperationResource resource.", - "hydra:method": "GET", - "hydra:title": "getOperationResource", - "returns": "OperationResource" - }, - { - "@type": "hydra:Operation", - "expects": "OperationResource", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json" - ] - } - ], - "hydra:description": "Updates the OperationResource resource.", - "hydra:method": "PATCH", - "hydra:title": "patchOperationResource", - "returns": "OperationResource" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "OperationResource", - "hydra:description": "Replaces the OperationResource resource.", - "hydra:method": "PUT", - "hydra:title": "putOperationResource", - "returns": "OperationResource" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the OperationResource resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteOperationResource", - "returns": "owl:Nothing" - } - ], "identifier": 1, "name": "Patched" } @@ -109,55 +60,6 @@ Feature: Resource operations "@context": "/contexts/OperationResource", "@id": "/operation_resources/1", "@type": "OperationResource", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a OperationResource resource.", - "hydra:method": "GET", - "hydra:title": "getOperationResource", - "returns": "OperationResource" - }, - { - "@type": "hydra:Operation", - "expects": "OperationResource", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json" - ] - } - ], - "hydra:description": "Updates the OperationResource resource.", - "hydra:method": "PATCH", - "hydra:title": "patchOperationResource", - "returns": "OperationResource" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "OperationResource", - "hydra:description": "Replaces the OperationResource resource.", - "hydra:method": "PUT", - "hydra:title": "putOperationResource", - "returns": "OperationResource" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the OperationResource resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteOperationResource", - "returns": "owl:Nothing" - } - ], "identifier": 1, "name": "Modified" } diff --git a/features/main/overridden_operation.feature b/features/main/overridden_operation.feature index c7b9e8d53c..d07181de8b 100644 --- a/features/main/overridden_operation.feature +++ b/features/main/overridden_operation.feature @@ -23,30 +23,6 @@ Feature: Create-Retrieve-Update-Delete with a Overridden Operation context "@context": "/contexts/OverriddenOperationDummy", "@id": "/overridden_operation_dummies/1", "@type": "OverriddenOperationDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a OverriddenOperationDummy resource.", - "hydra:method": "GET", - "hydra:title": "getOverriddenOperationDummy", - "returns": "OverriddenOperationDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "OverriddenOperationDummy", - "hydra:description": "Replaces the OverriddenOperationDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putOverriddenOperationDummy", - "returns": "OverriddenOperationDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the OverriddenOperationDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteOverriddenOperationDummy", - "returns": "owl:Nothing" - } - ], "name": "My Overridden Operation Dummy", "alias": null, "description": "Gerard" @@ -64,30 +40,6 @@ Feature: Create-Retrieve-Update-Delete with a Overridden Operation context "@context": "/contexts/OverriddenOperationDummy", "@id": "/overridden_operation_dummies/1", "@type": "OverriddenOperationDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a OverriddenOperationDummy resource.", - "hydra:method": "GET", - "hydra:title": "getOverriddenOperationDummy", - "returns": "OverriddenOperationDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "OverriddenOperationDummy", - "hydra:description": "Replaces the OverriddenOperationDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putOverriddenOperationDummy", - "returns": "OverriddenOperationDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the OverriddenOperationDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteOverriddenOperationDummy", - "returns": "owl:Nothing" - } - ], "name": "My Overridden Operation Dummy", "alias": null, "description": "Gerard" @@ -152,30 +104,6 @@ Feature: Create-Retrieve-Update-Delete with a Overridden Operation context "@context": "/contexts/OverriddenOperationDummy", "@id": "/overridden_operation_dummies/1", "@type": "OverriddenOperationDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a OverriddenOperationDummy resource.", - "hydra:method": "GET", - "hydra:title": "getOverriddenOperationDummy", - "returns": "OverriddenOperationDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "OverriddenOperationDummy", - "hydra:description": "Replaces the OverriddenOperationDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putOverriddenOperationDummy", - "returns": "OverriddenOperationDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the OverriddenOperationDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteOverriddenOperationDummy", - "returns": "owl:Nothing" - } - ], "alias": "Dummy", "description": "Gerard" } @@ -192,30 +120,6 @@ Feature: Create-Retrieve-Update-Delete with a Overridden Operation context "@context": "/contexts/OverriddenOperationDummy", "@id": "/overridden_operation_dummies/1", "@type": "OverriddenOperationDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a OverriddenOperationDummy resource.", - "hydra:method": "GET", - "hydra:title": "getOverriddenOperationDummy", - "returns": "OverriddenOperationDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "OverriddenOperationDummy", - "hydra:description": "Replaces the OverriddenOperationDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putOverriddenOperationDummy", - "returns": "OverriddenOperationDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the OverriddenOperationDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteOverriddenOperationDummy", - "returns": "owl:Nothing" - } - ], "name": "My Overridden Operation Dummy", "alias": "Dummy", "description": "Gerard" diff --git a/features/main/patch.feature b/features/main/patch.feature index e25bf33d3e..d6be7ec543 100644 --- a/features/main/patch.feature +++ b/features/main/patch.feature @@ -50,29 +50,6 @@ Feature: Sending PATCH requets "@context": "/contexts/PatchDummyRelation", "@id": "/patch_dummy_relations/1", "@type": "PatchDummyRelation", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a PatchDummyRelation resource.", - "hydra:method": "GET", - "hydra:title": "getPatchDummyRelation", - "returns": "PatchDummyRelation" - }, - { - "@type": "hydra:Operation", - "expects": "PatchDummyRelation", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the PatchDummyRelation resource.", - "hydra:method": "PATCH", - "hydra:title": "patchPatchDummyRelation", - "returns": "PatchDummyRelation" - } - ], "related": { "@id": "/related_dummies/1", "@type": "https://schema.org/Product", @@ -99,29 +76,6 @@ Feature: Sending PATCH requets "@context": "/contexts/Beta", "@id": "/betas/1", "@type": "Beta", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Beta resource.", - "hydra:method": "GET", - "hydra:title": "getBeta", - "returns": "owl:Nothing" - }, - { - "@type": "hydra:Operation", - "expects": "Beta", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Beta resource.", - "hydra:method": "PATCH", - "hydra:title": "patchBeta", - "returns": "Beta" - } - ], "betaId": 1, "alpha": "/alphas/2" } diff --git a/features/main/relation.feature b/features/main/relation.feature index 681a0bca30..5eba540f96 100644 --- a/features/main/relation.feature +++ b/features/main/relation.feature @@ -19,61 +19,11 @@ Feature: Relations support "@context": "/contexts/ThirdLevel", "@id": "/third_levels/1", "@type": "ThirdLevel", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a ThirdLevel resource.", - "hydra:method": "GET", - "hydra:title": "getThirdLevel", - "returns": "ThirdLevel" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "ThirdLevel", - "hydra:description": "Replaces the ThirdLevel resource.", - "hydra:method": "PUT", - "hydra:title": "putThirdLevel", - "returns": "ThirdLevel" - }, - { - "@type": "hydra:Operation", - "expects": "ThirdLevel", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the ThirdLevel resource.", - "hydra:method": "PATCH", - "hydra:title": "patchThirdLevel", - "returns": "ThirdLevel" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the ThirdLevel resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteThirdLevel", - "returns": "owl:Nothing" - } - ], + "fourthLevel": null, + "badFourthLevel": null, "id": 1, "level": 3, "test": true, - "fourthLevel": null, - "badFourthLevel": null, "relatedDummies": [] } """ @@ -93,56 +43,6 @@ Feature: Relations support "@context": "/contexts/DummyFriend", "@id": "/dummy_friends/1", "@type": "DummyFriend", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a DummyFriend resource.", - "hydra:method": "GET", - "hydra:title": "getDummyFriend", - "returns": "DummyFriend" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "DummyFriend", - "hydra:description": "Replaces the DummyFriend resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyFriend", - "returns": "DummyFriend" - }, - { - "@type": "hydra:Operation", - "expects": "DummyFriend", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the DummyFriend resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummyFriend", - "returns": "DummyFriend" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the DummyFriend resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyFriend", - "returns": "owl:Nothing" - } - ], "id": 1, "name": "Zoidberg" } @@ -163,56 +63,6 @@ Feature: Relations support "@context": "/contexts/RelatedDummy", "@id": "/related_dummies/1", "@type": "https://schema.org/Product", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a RelatedDummy resource.", - "hydra:method": "GET", - "hydra:title": "getRelatedDummy", - "returns": "RelatedDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "RelatedDummy", - "hydra:description": "Replaces the RelatedDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putRelatedDummy", - "returns": "RelatedDummy" - }, - { - "@type": "hydra:Operation", - "expects": "RelatedDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the RelatedDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchRelatedDummy", - "returns": "RelatedDummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the RelatedDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteRelatedDummy", - "returns": "owl:Nothing" - } - ], "id": 1, "name": null, "symfony": "symfony", @@ -249,56 +99,6 @@ Feature: Relations support "@context": "/contexts/RelatedToDummyFriend", "@id": "/related_to_dummy_friends/dummyFriend=1;relatedDummy=1", "@type": "RelatedToDummyFriend", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a RelatedToDummyFriend resource.", - "hydra:method": "GET", - "hydra:title": "getRelatedToDummyFriend", - "returns": "RelatedToDummyFriend" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "RelatedToDummyFriend", - "hydra:description": "Replaces the RelatedToDummyFriend resource.", - "hydra:method": "PUT", - "hydra:title": "putRelatedToDummyFriend", - "returns": "RelatedToDummyFriend" - }, - { - "@type": "hydra:Operation", - "expects": "RelatedToDummyFriend", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the RelatedToDummyFriend resource.", - "hydra:method": "PATCH", - "hydra:title": "patchRelatedToDummyFriend", - "returns": "RelatedToDummyFriend" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the RelatedToDummyFriend resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteRelatedToDummyFriend", - "returns": "owl:Nothing" - } - ], "name": "Friends relation", "description": null, "dummyFriend": { @@ -321,56 +121,6 @@ Feature: Relations support "@context": "/contexts/RelatedToDummyFriend", "@id": "/related_to_dummy_friends/dummyFriend=1;relatedDummy=1", "@type": "RelatedToDummyFriend", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a RelatedToDummyFriend resource.", - "hydra:method": "GET", - "hydra:title": "getRelatedToDummyFriend", - "returns": "RelatedToDummyFriend" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "RelatedToDummyFriend", - "hydra:description": "Replaces the RelatedToDummyFriend resource.", - "hydra:method": "PUT", - "hydra:title": "putRelatedToDummyFriend", - "returns": "RelatedToDummyFriend" - }, - { - "@type": "hydra:Operation", - "expects": "RelatedToDummyFriend", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the RelatedToDummyFriend resource.", - "hydra:method": "PATCH", - "hydra:title": "patchRelatedToDummyFriend", - "returns": "RelatedToDummyFriend" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the RelatedToDummyFriend resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteRelatedToDummyFriend", - "returns": "owl:Nothing" - } - ], "name": "Friends relation", "description": null, "dummyFriend": { @@ -421,57 +171,7 @@ Feature: Relations support "id": 1, "name": "Dummy with relations", "alias": null, - "foo": null, - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a Dummy resource.", - "hydra:method": "GET", - "hydra:title": "getDummy", - "returns": "Dummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "Dummy", - "hydra:description": "Replaces the Dummy resource.", - "hydra:method": "PUT", - "hydra:title": "putDummy", - "returns": "Dummy" - }, - { - "@type": "hydra:Operation", - "expects": "Dummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the Dummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummy", - "returns": "Dummy" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the Dummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummy", - "returns": "owl:Nothing" - } - ] + "foo": null } """ @@ -562,52 +262,6 @@ Feature: Relations support "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/1", "@type": "RelationEmbedder", - "operation": [ - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Deletes the RelationEmbedder resource.", - "hydra:method": "DELETE", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - } - ], "krondstadt": "Krondstadt", "anotherRelated": null, "related": { @@ -619,9 +273,9 @@ Feature: Relations support "@type": "ThirdLevel", "level": 3, "fourthLevel": null - } + } } - } + } """ Scenario: Create an existing relation @@ -643,52 +297,6 @@ Feature: Relations support "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/2", "@type": "RelationEmbedder", - "operation": [ - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Deletes the RelationEmbedder resource.", - "hydra:method": "DELETE", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - } - ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/2", @@ -697,12 +305,12 @@ Feature: Relations support "thirdLevel": null }, "related": null - } + } """ Scenario: Update the relation with a new one When I add "Content-Type" header equal to "application/ld+json" - And I send a "PUT" request to "/relation_embedders/1" with body: + And I send a "PUT" request to "/relation_embedders/2" with body: """ { "anotherRelated": { @@ -717,54 +325,8 @@ Feature: Relations support """ { "@context": "/contexts/RelationEmbedder", - "@id": "/relation_embedders/1", + "@id": "/relation_embedders/2", "@type": "RelationEmbedder", - "operation": [ - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Deletes the RelationEmbedder resource.", - "hydra:method": "DELETE", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - } - ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/3", @@ -772,17 +334,7 @@ Feature: Relations support "symfony": "laravel2", "thirdLevel": null }, - "related": { - "@id": "/related_dummies/1", - "@type": "https://schema.org/Product", - "symfony": "symfony", - "thirdLevel": { - "@id": "/third_levels/1", - "@type": "ThirdLevel", - "level": 3, - "fourthLevel": null - } - } + "related": null } """ @@ -834,52 +386,6 @@ Feature: Relations support "@context": "/contexts/RelationEmbedder", "@id": "/relation_embedders/2", "@type": "RelationEmbedder", - "operation": [ - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Deletes the RelationEmbedder resource.", - "hydra:method": "DELETE", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "hydra:description": "Retrieves a RelationEmbedder resource.", - "hydra:method": "GET", - "hydra:title": "A custom operation", - "returns": "xsd:string" - }, - { - "@type": "hydra:Operation", - "expects": "RelationEmbedder", - "hydra:description": "Replaces the RelationEmbedder resource.", - "hydra:method": "PUT", - "hydra:title": "A custom operation", - "returns": "xsd:string" - } - ], "krondstadt": "Krondstadt", "anotherRelated": { "@id": "/related_dummies/2", @@ -888,7 +394,7 @@ Feature: Relations support "thirdLevel": null }, "related": null - } + } """ @createSchema diff --git a/features/main/serializable_item_data_provider.feature b/features/main/serializable_item_data_provider.feature index 0e48cb4d65..11a111cf10 100644 --- a/features/main/serializable_item_data_provider.feature +++ b/features/main/serializable_item_data_provider.feature @@ -11,44 +11,6 @@ Feature: Serializable item data provider "@context": "/contexts/SerializableResource", "@id": "/serializable_resources/1", "@type": "SerializableResource", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a SerializableResource resource.", - "hydra:method": "GET", - "hydra:title": "getSerializableResource", - "returns": "SerializableResource" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "SerializableResource", - "hydra:description": "Replaces the SerializableResource resource.", - "hydra:method": "PUT", - "hydra:title": "putSerializableResource", - "returns": "SerializableResource" - }, - { - "@type": "hydra:Operation", - "expects": "SerializableResource", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the SerializableResource resource.", - "hydra:method": "PATCH", - "hydra:title": "patchSerializableResource", - "returns": "SerializableResource" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the SerializableResource resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteSerializableResource", - "returns": "owl:Nothing" - } - ], "id": 1, "foo": "Lorem", "bar": "Ipsum" diff --git a/features/main/standard_put.feature b/features/main/standard_put.feature index 2c13209afa..670ab6d0d0 100644 --- a/features/main/standard_put.feature +++ b/features/main/standard_put.feature @@ -20,23 +20,6 @@ Feature: Spec-compliant PUT support "@context": "/contexts/StandardPut", "@id": "/standard_puts/5", "@type": "StandardPut", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a StandardPut resource.", - "hydra:method": "GET", - "hydra:title": "getStandardPut", - "returns": "StandardPut" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "StandardPut", - "hydra:description": "Replaces the StandardPut resource.", - "hydra:method": "PUT", - "hydra:title": "putStandardPut", - "returns": "StandardPut" - } - ], "id": 5, "foo": "a", "bar": "b" @@ -63,23 +46,6 @@ Feature: Spec-compliant PUT support "@context": "/contexts/StandardPut", "@id": "/standard_puts/6", "@type": "StandardPut", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a StandardPut resource.", - "hydra:method": "GET", - "hydra:title": "getStandardPut", - "returns": "StandardPut" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "StandardPut", - "hydra:description": "Replaces the StandardPut resource.", - "hydra:method": "PUT", - "hydra:title": "putStandardPut", - "returns": "StandardPut" - } - ], "id": 6, "foo": "a", "bar": "b" @@ -130,23 +96,6 @@ Feature: Spec-compliant PUT support "@context": "/contexts/StandardPut", "@id": "/standard_puts/5", "@type": "StandardPut", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a StandardPut resource.", - "hydra:method": "GET", - "hydra:title": "getStandardPut", - "returns": "StandardPut" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "StandardPut", - "hydra:description": "Replaces the StandardPut resource.", - "hydra:method": "PUT", - "hydra:title": "putStandardPut", - "returns": "StandardPut" - } - ], "id": 5, "foo": "c", "bar": "" @@ -172,24 +121,7 @@ Feature: Spec-compliant PUT support "@id": "/uid_identifieds/fbcf5910-d915-4f7d-ba39-6b2957c57335", "@type": "UidIdentified", "id": "fbcf5910-d915-4f7d-ba39-6b2957c57335", - "name": "test", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a UidIdentified resource.", - "hydra:method": "GET", - "hydra:title": "getUidIdentified", - "returns": "owl:Nothing" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "UidIdentified", - "hydra:description": "Replaces the UidIdentified resource.", - "hydra:method": "PUT", - "hydra:title": "putUidIdentified", - "returns": "UidIdentified" - } - ] + "name": "test" } """ @@ -211,23 +143,6 @@ Feature: Spec-compliant PUT support "@id": "/uid_identifieds/fbcf5910-d915-4f7d-ba39-6b2957c57335", "@type": "UidIdentified", "id": "fbcf5910-d915-4f7d-ba39-6b2957c57335", - "name": "bar", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a UidIdentified resource.", - "hydra:method": "GET", - "hydra:title": "getUidIdentified", - "returns": "owl:Nothing" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "UidIdentified", - "hydra:description": "Replaces the UidIdentified resource.", - "hydra:method": "PUT", - "hydra:title": "putUidIdentified", - "returns": "UidIdentified" - } - ] + "name": "bar" } """ diff --git a/features/main/sub_resource.feature b/features/main/sub_resource.feature index 2c3a974e6e..1a8b9e14ad 100644 --- a/features/main/sub_resource.feature +++ b/features/main/sub_resource.feature @@ -15,44 +15,6 @@ Feature: Sub-resource support "@context": "/contexts/Answer", "@id": "/questions/1/answer", "@type": "Answer", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Answer resource.", - "hydra:method": "GET", - "hydra:title": "getAnswer", - "returns": "Answer" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Answer", - "hydra:description": "Replaces the Answer resource.", - "hydra:method": "PUT", - "hydra:title": "putAnswer", - "returns": "Answer" - }, - { - "@type": "hydra:Operation", - "expects": "Answer", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Answer resource.", - "hydra:method": "PATCH", - "hydra:title": "patchAnswer", - "returns": "Answer" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Answer resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteAnswer", - "returns": "owl:Nothing" - } - ], "id": 1, "content": "42", "question": "/questions/1", @@ -370,44 +332,6 @@ Feature: Sub-resource support "@context": "/contexts/RelatedDummy", "@id": "/dummies/1/related_dummies/2", "@type": "https://schema.org/Product", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a RelatedDummy resource.", - "hydra:method": "GET", - "hydra:title": "getRelatedDummy", - "returns": "RelatedDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "RelatedDummy", - "hydra:description": "Replaces the RelatedDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putRelatedDummy", - "returns": "RelatedDummy" - }, - { - "@type": "hydra:Operation", - "expects": "RelatedDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the RelatedDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchRelatedDummy", - "returns": "RelatedDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the RelatedDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteRelatedDummy", - "returns": "owl:Nothing" - } - ], "id": 2, "name": null, "symfony": "symfony", @@ -448,44 +372,6 @@ Feature: Sub-resource support "@context": "/contexts/ThirdLevel", "@id": "/dummies/1/related_dummies/1/third_level", "@type": "ThirdLevel", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a ThirdLevel resource.", - "hydra:method": "GET", - "hydra:title": "getThirdLevel", - "returns": "ThirdLevel" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "ThirdLevel", - "hydra:description": "Replaces the ThirdLevel resource.", - "hydra:method": "PUT", - "hydra:title": "putThirdLevel", - "returns": "ThirdLevel" - }, - { - "@type": "hydra:Operation", - "expects": "ThirdLevel", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the ThirdLevel resource.", - "hydra:method": "PATCH", - "hydra:title": "patchThirdLevel", - "returns": "ThirdLevel" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the ThirdLevel resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteThirdLevel", - "returns": "owl:Nothing" - } - ], "fourthLevel": "/fourth_levels/1", "badFourthLevel": null, "id": 1, @@ -509,44 +395,6 @@ Feature: Sub-resource support "@context": "/contexts/FourthLevel", "@id": "/dummies/1/related_dummies/1/third_level/fourth_level", "@type": "FourthLevel", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a FourthLevel resource.", - "hydra:method": "GET", - "hydra:title": "getFourthLevel", - "returns": "FourthLevel" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "FourthLevel", - "hydra:description": "Replaces the FourthLevel resource.", - "hydra:method": "PUT", - "hydra:title": "putFourthLevel", - "returns": "FourthLevel" - }, - { - "@type": "hydra:Operation", - "expects": "FourthLevel", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the FourthLevel resource.", - "hydra:method": "PATCH", - "hydra:title": "patchFourthLevel", - "returns": "FourthLevel" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the FourthLevel resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteFourthLevel", - "returns": "owl:Nothing" - } - ], "badThirdLevel": [], "id": 1, "level": 4 @@ -640,60 +488,10 @@ Feature: Sub-resource support "@context": "/contexts/DummyProduct", "@id": "/dummy_products/2", "@type": "DummyProduct", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a DummyProduct resource.", - "hydra:method": "GET", - "hydra:title": "getDummyProduct", - "returns": "DummyProduct" - }, - { - "@type": [ - "hydra:Operation", - "schema:ReplaceAction" - ], - "expects": "DummyProduct", - "hydra:description": "Replaces the DummyProduct resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyProduct", - "returns": "DummyProduct" - }, - { - "@type": "hydra:Operation", - "expects": "DummyProduct", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": [ - "application/merge-patch+json", - "application/vnd.api+json" - ] - } - ], - "hydra:description": "Updates the DummyProduct resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummyProduct", - "returns": "DummyProduct" - }, - { - "@type": [ - "hydra:Operation", - "schema:DeleteAction" - ], - "hydra:description": "Deletes the DummyProduct resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyProduct", - "returns": "owl:Nothing" - } - ], - "id": 2, "offers": [ "/dummy_aggregate_offers/1" ], + "id": 2, "name": "Dummy product", "relatedProducts": [ "/dummy_products/1" @@ -715,44 +513,6 @@ Feature: Sub-resource support "@context": "/contexts/Dummy", "@id": "/related_owned_dummies/1/owning_dummy", "@type": "Dummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Dummy resource.", - "hydra:method": "GET", - "hydra:title": "getDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Dummy", - "hydra:description": "Replaces the Dummy resource.", - "hydra:method": "PUT", - "hydra:title": "putDummy", - "returns": "Dummy" - }, - { - "@type": "hydra:Operation", - "expects": "Dummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Dummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Dummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummy", - "returns": "owl:Nothing" - } - ], "description": null, "dummy": null, "dummyBoolean": null, @@ -786,44 +546,6 @@ Feature: Sub-resource support "@context": "/contexts/Dummy", "@id": "/related_owning_dummies/1/owned_dummy", "@type": "Dummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Dummy resource.", - "hydra:method": "GET", - "hydra:title": "getDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Dummy", - "hydra:description": "Replaces the Dummy resource.", - "hydra:method": "PUT", - "hydra:title": "putDummy", - "returns": "Dummy" - }, - { - "@type": "hydra:Operation", - "expects": "Dummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Dummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Dummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummy", - "returns": "owl:Nothing" - } - ], "description": null, "dummy": null, "dummyBoolean": null, diff --git a/features/main/table_inheritance.feature b/features/main/table_inheritance.feature index cd4e7b3263..1c3617f5f9 100644 --- a/features/main/table_inheritance.feature +++ b/features/main/table_inheritance.feature @@ -544,7 +544,6 @@ Feature: Table inheritance "type": "string", "pattern": "^ResourceInterface$" }, - "operation": {"type": "array"}, "foo": { "type": "string", "pattern": "^single item$" diff --git a/features/main/url_encoded_id.feature b/features/main/url_encoded_id.feature index b2b480c783..6e5828bbab 100644 --- a/features/main/url_encoded_id.feature +++ b/features/main/url_encoded_id.feature @@ -15,15 +15,6 @@ Feature: Allowing resource identifiers with characters that should be URL encode "@context": "/contexts/UrlEncodedId", "@id": "/url_encoded_ids/%25encode:id", "@type": "UrlEncodedId", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a UrlEncodedId resource.", - "hydra:method": "GET", - "hydra:title": "getUrlEncodedId", - "returns": "UrlEncodedId" - } - ], "id": "%encode:id" } """ diff --git a/features/main/uuid.feature b/features/main/uuid.feature index 53c3e45c9f..a7506a15be 100644 --- a/features/main/uuid.feature +++ b/features/main/uuid.feature @@ -30,44 +30,6 @@ Feature: Using uuid identifier on resource "@context": "/contexts/UuidIdentifierDummy", "@id": "/uuid_identifier_dummies/41b29566-144b-11e6-a148-3e1d05defe78", "@type": "UuidIdentifierDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a UuidIdentifierDummy resource.", - "hydra:method": "GET", - "hydra:title": "getUuidIdentifierDummy", - "returns": "UuidIdentifierDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "UuidIdentifierDummy", - "hydra:description": "Replaces the UuidIdentifierDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putUuidIdentifierDummy", - "returns": "UuidIdentifierDummy" - }, - { - "@type": "hydra:Operation", - "expects": "UuidIdentifierDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the UuidIdentifierDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchUuidIdentifierDummy", - "returns": "UuidIdentifierDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the UuidIdentifierDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteUuidIdentifierDummy", - "returns": "owl:Nothing" - } - ], "uuid": "41b29566-144b-11e6-a148-3e1d05defe78", "name": "My Dummy" } @@ -114,44 +76,6 @@ Feature: Using uuid identifier on resource "@context": "/contexts/UuidIdentifierDummy", "@id": "/uuid_identifier_dummies/41b29566-144b-11e6-a148-3e1d05defe78", "@type": "UuidIdentifierDummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a UuidIdentifierDummy resource.", - "hydra:method": "GET", - "hydra:title": "getUuidIdentifierDummy", - "returns": "UuidIdentifierDummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "UuidIdentifierDummy", - "hydra:description": "Replaces the UuidIdentifierDummy resource.", - "hydra:method": "PUT", - "hydra:title": "putUuidIdentifierDummy", - "returns": "UuidIdentifierDummy" - }, - { - "@type": "hydra:Operation", - "expects": "UuidIdentifierDummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the UuidIdentifierDummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchUuidIdentifierDummy", - "returns": "UuidIdentifierDummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the UuidIdentifierDummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteUuidIdentifierDummy", - "returns": "owl:Nothing" - } - ], "uuid": "41b29566-144b-11e6-a148-3e1d05defe78", "name": "My Dummy modified" } @@ -174,44 +98,6 @@ Feature: Using uuid identifier on resource "@context": "/contexts/CustomGeneratedIdentifier", "@id": "/custom_generated_identifiers/foo", "@type": "CustomGeneratedIdentifier", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a CustomGeneratedIdentifier resource.", - "hydra:method": "GET", - "hydra:title": "getCustomGeneratedIdentifier", - "returns": "CustomGeneratedIdentifier" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "CustomGeneratedIdentifier", - "hydra:description": "Replaces the CustomGeneratedIdentifier resource.", - "hydra:method": "PUT", - "hydra:title": "putCustomGeneratedIdentifier", - "returns": "CustomGeneratedIdentifier" - }, - { - "@type": "hydra:Operation", - "expects": "CustomGeneratedIdentifier", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the CustomGeneratedIdentifier resource.", - "hydra:method": "PATCH", - "hydra:title": "patchCustomGeneratedIdentifier", - "returns": "CustomGeneratedIdentifier" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the CustomGeneratedIdentifier resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteCustomGeneratedIdentifier", - "returns": "owl:Nothing" - } - ], "id": "foo" } """ diff --git a/features/mercure/publish.feature b/features/mercure/publish.feature index d7397443d8..ac0c27fa7e 100644 --- a/features/mercure/publish.feature +++ b/features/mercure/publish.feature @@ -1,4 +1,3 @@ -@mercure Feature: Mercure publish support In order to publish an Update to the Mercure hub As a developer @@ -28,15 +27,6 @@ Feature: Mercure publish support "@context": "/contexts/MercureWithTopics", "@id": "/issue5074/mercure_with_topics/1", "@type": "MercureWithTopics", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a MercureWithTopics resource.", - "hydra:method": "GET", - "hydra:title": "getMercureWithTopics", - "returns": "MercureWithTopics" - } - ], "id": 1, "name": "Hello World!" } @@ -64,22 +54,6 @@ Feature: Mercure publish support "@context": "/contexts/MercureWithTopicsAndGetOperation", "@id": "/mercure_with_topics_and_get_operations/1", "@type": "MercureWithTopicsAndGetOperation", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a MercureWithTopicsAndGetOperation resource.", - "hydra:method": "GET", - "hydra:title": "getMercureWithTopicsAndGetOperation", - "returns": "MercureWithTopicsAndGetOperation" - }, - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a MercureWithTopicsAndGetOperation resource.", - "hydra:method": "GET", - "hydra:title": "getMercureWithTopicsAndGetOperation", - "returns": "MercureWithTopicsAndGetOperation" - } - ], "id": 1, "name": "Hello World!" } diff --git a/features/security/strong_typing.feature b/features/security/strong_typing.feature index a720c96534..27e669816d 100644 --- a/features/security/strong_typing.feature +++ b/features/security/strong_typing.feature @@ -22,44 +22,6 @@ Feature: Handle properly invalid data submitted to the API "@context": "/contexts/Dummy", "@id": "/dummies/1", "@type": "Dummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Dummy resource.", - "hydra:method": "GET", - "hydra:title": "getDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Dummy", - "hydra:description": "Replaces the Dummy resource.", - "hydra:method": "PUT", - "hydra:title": "putDummy", - "returns": "Dummy" - }, - { - "@type": "hydra:Operation", - "expects": "Dummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Dummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Dummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummy", - "returns": "owl:Nothing" - } - ], "description": null, "dummy": null, "dummyBoolean": null, diff --git a/features/security/unknown_attributes.feature b/features/security/unknown_attributes.feature index 5396147f0b..efe7b954c0 100644 --- a/features/security/unknown_attributes.feature +++ b/features/security/unknown_attributes.feature @@ -22,44 +22,6 @@ Feature: Ignore unknown attributes "@context": "/contexts/Dummy", "@id": "/dummies/1", "@type": "Dummy", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a Dummy resource.", - "hydra:method": "GET", - "hydra:title": "getDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "Dummy", - "hydra:description": "Replaces the Dummy resource.", - "hydra:method": "PUT", - "hydra:title": "putDummy", - "returns": "Dummy" - }, - { - "@type": "hydra:Operation", - "expects": "Dummy", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the Dummy resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummy", - "returns": "Dummy" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the Dummy resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummy", - "returns": "owl:Nothing" - } - ], "description": null, "dummy": null, "dummyBoolean": null, diff --git a/features/serializer/empty_array_as_object.feature b/features/serializer/empty_array_as_object.feature index 9f6f0b4e4f..c0cc854817 100644 --- a/features/serializer/empty_array_as_object.feature +++ b/features/serializer/empty_array_as_object.feature @@ -16,15 +16,6 @@ Feature: Serialize empty array as object "@context": "/contexts/EmptyArrayAsObject", "@id": "/empty_array_as_objects/6", "@type": "EmptyArrayAsObject", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a EmptyArrayAsObject resource.", - "hydra:method": "GET", - "hydra:title": "getEmptyArrayAsObject", - "returns": "EmptyArrayAsObject" - } - ], "id": 6, "emptyArray": [], "emptyArrayAsObject": {}, diff --git a/features/serializer/group_filter.feature b/features/serializer/group_filter.feature index f2f5ab9803..95de871d40 100644 --- a/features/serializer/group_filter.feature +++ b/features/serializer/group_filter.feature @@ -554,7 +554,6 @@ Feature: Filter with serialization groups on items and collections "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, "@type": {"pattern": "^DummyGroup$"}, - "operation": {"type": "array"}, "id": {}, "foo": {}, "bar": {}, @@ -578,7 +577,6 @@ Feature: Filter with serialization groups on items and collections "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, "@type": {"pattern": "^DummyGroup$"}, - "operation": {"type": "array"}, "foo": {} }, "additionalProperties": false, @@ -599,7 +597,6 @@ Feature: Filter with serialization groups on items and collections "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, "@type": {"pattern": "^DummyGroup$"}, - "operation": {"type": "array"}, "id": {}, "foo": {}, "bar": {}, @@ -624,7 +621,6 @@ Feature: Filter with serialization groups on items and collections "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, "@type": {"pattern": "^DummyGroup$"}, - "operation": {"type": "array"}, "foo": {}, "qux": {} }, @@ -646,7 +642,6 @@ Feature: Filter with serialization groups on items and collections "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, "@type": {"pattern": "^DummyGroup$"}, - "operation": {"type": "array"}, "id": {}, "foo": {}, "bar": {}, @@ -670,7 +665,6 @@ Feature: Filter with serialization groups on items and collections "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, "@type": {"pattern": "^DummyGroup$"}, - "operation": {"type": "array"}, "foo": {} }, "additionalProperties": false, @@ -691,7 +685,6 @@ Feature: Filter with serialization groups on items and collections "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, "@type": {"pattern": "^DummyGroup$"}, - "operation": {"type": "array"}, "id": {}, "foo": {}, "bar": {}, @@ -714,8 +707,7 @@ Feature: Filter with serialization groups on items and collections "properties": { "@context": {"pattern": "^/contexts/DummyGroup$"}, "@id": {"pattern": "^/dummy_groups/1$"}, - "@type": {"pattern": "^DummyGroup$"}, - "operation": {"type": "array"} + "@type": {"pattern": "^DummyGroup$"} }, "additionalProperties": false, "required": ["@context", "@id", "@type"] @@ -742,44 +734,6 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/11", "@type": "DummyGroup", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a DummyGroup resource.", - "hydra:method": "GET", - "hydra:title": "getDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "DummyGroup", - "hydra:description": "Replaces the DummyGroup resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": "hydra:Operation", - "expects": "DummyGroup", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the DummyGroup resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the DummyGroup resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyGroup", - "returns": "owl:Nothing" - } - ], "id": 11, "foo": "Foo", "bar": "Bar", @@ -807,44 +761,6 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/12", "@type": "DummyGroup", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a DummyGroup resource.", - "hydra:method": "GET", - "hydra:title": "getDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "DummyGroup", - "hydra:description": "Replaces the DummyGroup resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": "hydra:Operation", - "expects": "DummyGroup", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the DummyGroup resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the DummyGroup resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyGroup", - "returns": "owl:Nothing" - } - ], "foo": "Foo" } """ @@ -869,44 +785,6 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/13", "@type": "DummyGroup", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a DummyGroup resource.", - "hydra:method": "GET", - "hydra:title": "getDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "DummyGroup", - "hydra:description": "Replaces the DummyGroup resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": "hydra:Operation", - "expects": "DummyGroup", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the DummyGroup resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the DummyGroup resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyGroup", - "returns": "owl:Nothing" - } - ], "id": 13, "foo": "Foo", "bar": "Bar", @@ -935,44 +813,6 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/14", "@type": "DummyGroup", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a DummyGroup resource.", - "hydra:method": "GET", - "hydra:title": "getDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "DummyGroup", - "hydra:description": "Replaces the DummyGroup resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": "hydra:Operation", - "expects": "DummyGroup", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the DummyGroup resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the DummyGroup resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyGroup", - "returns": "owl:Nothing" - } - ], "foo": "Foo", "baz": "Baz", "qux": "Qux" @@ -999,44 +839,6 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/15", "@type": "DummyGroup", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a DummyGroup resource.", - "hydra:method": "GET", - "hydra:title": "getDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "DummyGroup", - "hydra:description": "Replaces the DummyGroup resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": "hydra:Operation", - "expects": "DummyGroup", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the DummyGroup resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the DummyGroup resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyGroup", - "returns": "owl:Nothing" - } - ], "id": 15, "foo": "Foo", "bar": "Bar", @@ -1065,44 +867,6 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/16", "@type": "DummyGroup", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a DummyGroup resource.", - "hydra:method": "GET", - "hydra:title": "getDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "DummyGroup", - "hydra:description": "Replaces the DummyGroup resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": "hydra:Operation", - "expects": "DummyGroup", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the DummyGroup resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the DummyGroup resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyGroup", - "returns": "owl:Nothing" - } - ], "id": 16, "foo": "Foo", "bar": "Bar", @@ -1131,44 +895,6 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/17", "@type": "DummyGroup", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a DummyGroup resource.", - "hydra:method": "GET", - "hydra:title": "getDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "DummyGroup", - "hydra:description": "Replaces the DummyGroup resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": "hydra:Operation", - "expects": "DummyGroup", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the DummyGroup resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the DummyGroup resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyGroup", - "returns": "owl:Nothing" - } - ], "id": 17, "foo": "Foo", "bar": "Bar", @@ -1195,45 +921,7 @@ Feature: Filter with serialization groups on items and collections { "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/18", - "@type": "DummyGroup", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a DummyGroup resource.", - "hydra:method": "GET", - "hydra:title": "getDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "DummyGroup", - "hydra:description": "Replaces the DummyGroup resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": "hydra:Operation", - "expects": "DummyGroup", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the DummyGroup resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the DummyGroup resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyGroup", - "returns": "owl:Nothing" - } - ] + "@type": "DummyGroup" } """ @@ -1257,44 +945,6 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/19", "@type": "DummyGroup", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a DummyGroup resource.", - "hydra:method": "GET", - "hydra:title": "getDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "DummyGroup", - "hydra:description": "Replaces the DummyGroup resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": "hydra:Operation", - "expects": "DummyGroup", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the DummyGroup resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the DummyGroup resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyGroup", - "returns": "owl:Nothing" - } - ], "id": 19, "foo": "Foo", "bar": "Bar", @@ -1322,44 +972,6 @@ Feature: Filter with serialization groups on items and collections "@context": "/contexts/DummyGroup", "@id": "/dummy_groups/20", "@type": "DummyGroup", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a DummyGroup resource.", - "hydra:method": "GET", - "hydra:title": "getDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "DummyGroup", - "hydra:description": "Replaces the DummyGroup resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": "hydra:Operation", - "expects": "DummyGroup", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the DummyGroup resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummyGroup", - "returns": "DummyGroup" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the DummyGroup resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyGroup", - "returns": "owl:Nothing" - } - ], "baz": "Baz" } """ diff --git a/features/serializer/property_filter.feature b/features/serializer/property_filter.feature index 23e99d67d6..7da85deb69 100644 --- a/features/serializer/property_filter.feature +++ b/features/serializer/property_filter.feature @@ -285,7 +285,6 @@ Feature: Filter with serialization attributes on items and collections "@context": {"pattern": "^/contexts/DummyProperty$"}, "@id": {"pattern": "^/dummy_properties/1$"}, "@type": {"pattern": "^DummyProperty$"}, - "operation": {"type": "array"}, "id": {}, "foo": {}, "bar": {} @@ -308,7 +307,6 @@ Feature: Filter with serialization attributes on items and collections "@context": {"pattern": "^/contexts/DummyProperty$"}, "@id": {"pattern": "^/dummy_properties/1$"}, "@type": {"pattern": "^DummyProperty$"}, - "operation": {"type": "array"}, "foo": {}, "bar": {}, "group": { @@ -316,7 +314,6 @@ Feature: Filter with serialization attributes on items and collections "properties": { "@id": {}, "@type": {}, - "operation": {"type": "array"}, "baz": {} }, "additionalProperties": false, @@ -341,13 +338,11 @@ Feature: Filter with serialization attributes on items and collections "@context": {"pattern": "^/contexts/DummyProperty$"}, "@id": {"pattern": "^/dummy_properties/1$"}, "@type": {"pattern": "^DummyProperty$"}, - "operation": {"type": "array"}, "group": { "type": "object", "properties": { "@id": {}, - "@type": {}, - "operation": {"type": "array"} + "@type": {} }, "additionalProperties": false, "required": ["@id", "@type"] @@ -376,44 +371,6 @@ Feature: Filter with serialization attributes on items and collections "@context": "/contexts/DummyProperty", "@id": "/dummy_properties/11", "@type": "DummyProperty", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a DummyProperty resource.", - "hydra:method": "GET", - "hydra:title": "getDummyProperty", - "returns": "DummyProperty" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "DummyProperty", - "hydra:description": "Replaces the DummyProperty resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyProperty", - "returns": "DummyProperty" - }, - { - "@type": "hydra:Operation", - "expects": "DummyProperty", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the DummyProperty resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummyProperty", - "returns": "DummyProperty" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the DummyProperty resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyProperty", - "returns": "owl:Nothing" - } - ], "foo": "Foo", "bar": "Bar" } @@ -442,44 +399,6 @@ Feature: Filter with serialization attributes on items and collections "@context": "/contexts/DummyProperty", "@id": "/dummy_properties/12", "@type": "DummyProperty", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a DummyProperty resource.", - "hydra:method": "GET", - "hydra:title": "getDummyProperty", - "returns": "DummyProperty" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "DummyProperty", - "hydra:description": "Replaces the DummyProperty resource.", - "hydra:method": "PUT", - "hydra:title": "putDummyProperty", - "returns": "DummyProperty" - }, - { - "@type": "hydra:Operation", - "expects": "DummyProperty", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the DummyProperty resource.", - "hydra:method": "PATCH", - "hydra:title": "patchDummyProperty", - "returns": "DummyProperty" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the DummyProperty resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteDummyProperty", - "returns": "owl:Nothing" - } - ], "foo": "Foo", "bar": "Bar", "group": { diff --git a/features/serializer/vo_relations.feature b/features/serializer/vo_relations.feature index 6ae69c8d9b..08999440a5 100644 --- a/features/serializer/vo_relations.feature +++ b/features/serializer/vo_relations.feature @@ -30,44 +30,6 @@ Feature: Value object as ApiResource "@context": "/contexts/VoDummyCar", "@id": "/vo_dummy_cars/1", "@type": "VoDummyCar", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a VoDummyCar resource.", - "hydra:method": "GET", - "hydra:title": "getVoDummyCar", - "returns": "VoDummyCar" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "VoDummyCar", - "hydra:description": "Replaces the VoDummyCar resource.", - "hydra:method": "PUT", - "hydra:title": "putVoDummyCar", - "returns": "VoDummyCar" - }, - { - "@type": "hydra:Operation", - "expects": "VoDummyCar", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the VoDummyCar resource.", - "hydra:method": "PATCH", - "hydra:title": "patchVoDummyCar", - "returns": "VoDummyCar" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the VoDummyCar resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteVoDummyCar", - "returns": "owl:Nothing" - } - ], "mileage": 1500, "bodyType": "suv", "inspections": [], @@ -134,47 +96,9 @@ Feature: Value object as ApiResource "@context": "/contexts/VoDummyInspection", "@id": "/vo_dummy_inspections/1", "@type": "VoDummyInspection", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a VoDummyInspection resource.", - "hydra:method": "GET", - "hydra:title": "getVoDummyInspection", - "returns": "VoDummyInspection" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "VoDummyInspection", - "hydra:description": "Replaces the VoDummyInspection resource.", - "hydra:method": "PUT", - "hydra:title": "putVoDummyInspection", - "returns": "VoDummyInspection" - }, - { - "@type": "hydra:Operation", - "expects": "VoDummyInspection", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the VoDummyInspection resource.", - "hydra:method": "PATCH", - "hydra:title": "patchVoDummyInspection", - "returns": "VoDummyInspection" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the VoDummyInspection resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteVoDummyInspection", - "returns": "owl:Nothing" - } - ], - "performed": "2018-08-24T00:00:00+00:00", "accepted": true, - "car": "/vo_dummy_cars/1" + "car": "/vo_dummy_cars/1", + "performed": "2018-08-24T00:00:00+00:00" } """ @@ -194,47 +118,9 @@ Feature: Value object as ApiResource "@context": "/contexts/VoDummyInspection", "@id": "/vo_dummy_inspections/1", "@type": "VoDummyInspection", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a VoDummyInspection resource.", - "hydra:method": "GET", - "hydra:title": "getVoDummyInspection", - "returns": "VoDummyInspection" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "VoDummyInspection", - "hydra:description": "Replaces the VoDummyInspection resource.", - "hydra:method": "PUT", - "hydra:title": "putVoDummyInspection", - "returns": "VoDummyInspection" - }, - { - "@type": "hydra:Operation", - "expects": "VoDummyInspection", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the VoDummyInspection resource.", - "hydra:method": "PATCH", - "hydra:title": "patchVoDummyInspection", - "returns": "VoDummyInspection" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the VoDummyInspection resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteVoDummyInspection", - "returns": "owl:Nothing" - } - ], - "performed": "2018-08-24T00:00:00+00:00", "accepted": true, - "car": "/vo_dummy_cars/1" + "car": "/vo_dummy_cars/1", + "performed": "2018-08-24T00:00:00+00:00" } """ @@ -301,47 +187,15 @@ Feature: Value object as ApiResource "@context": "/contexts/VoDummyCar", "@id": "/vo_dummy_cars/1", "@type": "VoDummyCar", - "operation": [ - { - "@type": ["hydra:Operation", "schema:FindAction"], - "hydra:description": "Retrieves a VoDummyCar resource.", - "hydra:method": "GET", - "hydra:title": "getVoDummyCar", - "returns": "VoDummyCar" - }, - { - "@type": ["hydra:Operation", "schema:ReplaceAction"], - "expects": "VoDummyCar", - "hydra:description": "Replaces the VoDummyCar resource.", - "hydra:method": "PUT", - "hydra:title": "putVoDummyCar", - "returns": "VoDummyCar" - }, - { - "@type": "hydra:Operation", - "expects": "VoDummyCar", - "expectsHeader": [ - { - "headerName": "Content-Type", - "possibleValue": ["application/merge-patch+json", "application/vnd.api+json"] - } - ], - "hydra:description": "Updates the VoDummyCar resource.", - "hydra:method": "PATCH", - "hydra:title": "patchVoDummyCar", - "returns": "VoDummyCar" - }, - { - "@type": ["hydra:Operation", "schema:DeleteAction"], - "hydra:description": "Deletes the VoDummyCar resource.", - "hydra:method": "DELETE", - "hydra:title": "deleteVoDummyCar", - "returns": "owl:Nothing" - } - ], - "inspections": [], "mileage": 1500, "bodyType": "coupe", + "inspections": [], + "make": "CustomCar", + "insuranceCompany": { + "@id": "/vo_dummy_insurance_companies/1", + "@type": "VoDummyInsuranceCompany", + "name": "Safe Drive Company" + }, "drivers": [ { "@id": "/vo_dummy_drivers/1", @@ -349,13 +203,7 @@ Feature: Value object as ApiResource "firstName": "John", "lastName": "Doe" } - ], - "make": "CustomCar", - "insuranceCompany": { - "@id": "/vo_dummy_insurance_companies/1", - "@type": "VoDummyInsuranceCompany", - "name": "Safe Drive Company" - } + ] } """ And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8" diff --git a/features/sub_resources/multiple_relation.feature b/features/sub_resources/multiple_relation.feature index 6511d23f6e..c774257aa3 100644 --- a/features/sub_resources/multiple_relation.feature +++ b/features/sub_resources/multiple_relation.feature @@ -21,18 +21,6 @@ Feature: JSON-LD multi relation "@context": "/contexts/RelationMultiple", "@id": "/dummy/1/relations/2", "@type": "RelationMultiple", - "operation": [ - { - "@type": [ - "hydra:Operation", - "schema:FindAction" - ], - "hydra:description": "Retrieves a RelationMultiple resource.", - "hydra:method": "GET", - "hydra:title": "getRelationMultiple", - "returns": "RelationMultiple" - } - ], "id": 1, "first": "/dummies/1", "second": "/dummies/2"