class JsonEncoder in JSON:API 8.2
Same name and namespace in other branches
- 8 src/Encoder/JsonEncoder.php \Drupal\jsonapi\Encoder\JsonEncoder
Encodes JSON:API data.
@internal JSON:API maintains no PHP API. The API is the HTTP API. This class may change at any time and could break any dependencies on it.
Hierarchy
- class \Drupal\serialization\Encoder\JsonEncoder extends \Symfony\Component\Serializer\Encoder\JsonEncoder implements \Symfony\Component\Serializer\Encoder\EncoderInterface, \Symfony\Component\Serializer\Encoder\DecoderInterface
- class \Drupal\jsonapi\Encoder\JsonEncoder
Expanded class hierarchy of JsonEncoder
See also
https://www.drupal.org/project/jsonapi/issues/3032787
1 file declares its use of JsonEncoder
- ResourceResponseValidatorTest.php in tests/
src/ Unit/ EventSubscriber/ ResourceResponseValidatorTest.php
1 string reference to 'JsonEncoder'
1 service uses JsonEncoder
File
- src/
Encoder/ JsonEncoder.php, line 16
Namespace
Drupal\jsonapi\EncoderView source
class JsonEncoder extends SerializationJsonEncoder {
/**
* The formats that this Encoder supports.
*
* @var string
*/
protected static $format = [
'api_json',
];
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
JsonEncoder:: |
protected static | property |
The formats that this Encoder supports. Overrides JsonEncoder:: |
|
JsonEncoder:: |
private | function | Instantiates a JsonDecode instance. | |
JsonEncoder:: |
private | function | Instantiates a JsonEncode instance. | |
JsonEncoder:: |
public | function | Checks whether the deserializer can decode from given format. | |
JsonEncoder:: |
public | function | Checks whether the serializer can encode to given format. | |
JsonEncoder:: |
public | function |