NoSerializationClassTestResource.php
Same filename in other branches
- 9 core/modules/rest/tests/modules/rest_test/src/Plugin/rest/resource/NoSerializationClassTestResource.php
- 8.9.x core/modules/rest/tests/modules/rest_test/src/Plugin/rest/resource/NoSerializationClassTestResource.php
- 10 core/modules/rest/tests/modules/rest_test/src/Plugin/rest/resource/NoSerializationClassTestResource.php
Namespace
Drupal\rest_test\Plugin\rest\resourceFile
-
core/
modules/ rest/ tests/ modules/ rest_test/ src/ Plugin/ rest/ resource/ NoSerializationClassTestResource.php
View source
<?php
declare (strict_types=1);
namespace Drupal\rest_test\Plugin\rest\resource;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\rest\Attribute\RestResource;
use Drupal\rest\Plugin\ResourceBase;
use Drupal\rest\ResourceResponse;
/**
* Class used to test that serialization_class is optional.
*/
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);
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
NoSerializationClassTestResource | Class used to test that serialization_class is optional. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.