You are here

public function JSONFieldEnhancer::getOutputJsonSchema in JSON:API Extras 8.3

Same name and namespace in other branches
  1. 8.2 src/Plugin/jsonapi/FieldEnhancer/JSONFieldEnhancer.php \Drupal\jsonapi_extras\Plugin\jsonapi\FieldEnhancer\JSONFieldEnhancer::getOutputJsonSchema()

Get the JSON Schema for the new output.

Return value

array An structured array representing the JSON Schema of the new output.

Overrides ResourceFieldEnhancerInterface::getOutputJsonSchema

File

src/Plugin/jsonapi/FieldEnhancer/JSONFieldEnhancer.php, line 77

Class

JSONFieldEnhancer
Perform additional manipulations to JSON fields.

Namespace

Drupal\jsonapi_extras\Plugin\jsonapi\FieldEnhancer

Code

public function getOutputJsonSchema() {
  return [
    'oneOf' => [
      [
        'type' => 'object',
      ],
      [
        'type' => 'array',
      ],
      [
        'type' => 'null',
      ],
    ],
  ];
}