class NoSerializationClassTestResource
Same name and namespace in other branches
- 11.x core/modules/rest/tests/modules/rest_test/src/Plugin/rest/resource/NoSerializationClassTestResource.php \Drupal\rest_test\Plugin\rest\resource\NoSerializationClassTestResource
Class used to test that serialization_class is optional.
Plugin annotation
@RestResource(
id = "serialization_test",
label = @Translation("Optional serialization_class"),
serialization_class = "",
uri_paths = {}
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
- class \Drupal\rest\Plugin\ResourceBase extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\rest\Plugin\ResourceInterface implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\rest_test\Plugin\rest\resource\NoSerializationClassTestResource implements \Drupal\rest\Plugin\ResourceBase
- class \Drupal\rest\Plugin\ResourceBase extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\rest\Plugin\ResourceInterface implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of NoSerializationClassTestResource
File
-
core/
modules/ rest/ tests/ modules/ rest_test/ src/ Plugin/ rest/ resource/ NoSerializationClassTestResource.php, line 18
Namespace
Drupal\rest_test\Plugin\rest\resourceView source
class NoSerializationClassTestResource extends ResourceBase {
/**
* Responds to a POST request.
*
* @param array $data
* An array with the payload.
*
* @return \Drupal\rest\ResourceResponse
*/
public function post(array $data) {
return new ResourceResponse($data);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.