JsonEncoder.php

Same filename in this branch
  1. 11.x core/modules/serialization/src/Encoder/JsonEncoder.php
Same filename in other branches
  1. 9 core/modules/jsonapi/src/Encoder/JsonEncoder.php
  2. 9 core/modules/serialization/src/Encoder/JsonEncoder.php
  3. 9 core/modules/hal/src/Encoder/JsonEncoder.php
  4. 8.9.x core/modules/jsonapi/src/Encoder/JsonEncoder.php
  5. 8.9.x core/modules/serialization/src/Encoder/JsonEncoder.php
  6. 8.9.x core/modules/hal/src/Encoder/JsonEncoder.php
  7. 10 core/modules/jsonapi/src/Encoder/JsonEncoder.php
  8. 10 core/modules/serialization/src/Encoder/JsonEncoder.php

Namespace

Drupal\jsonapi\Encoder

File

core/modules/jsonapi/src/Encoder/JsonEncoder.php

View source
<?php

namespace Drupal\jsonapi\Encoder;

use Drupal\serialization\Encoder\JsonEncoder as SerializationJsonEncoder;

/**
 * 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.
 *
 * @see https://www.drupal.org/project/drupal/issues/3032787
 * @see jsonapi.api.php
 */
class JsonEncoder extends SerializationJsonEncoder {
    
    /**
     * The formats that this Encoder supports.
     *
     * @var string
     */
    protected static $format = [
        'api_json',
    ];

}

Classes

Title Deprecated Summary
JsonEncoder Encodes JSON:API data.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.