You are here

public function ImageStyles::getOutputJsonSchema in Consumer Image Styles 4.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/jsonapi/FieldEnhancer/ImageStyles.php \Drupal\consumer_image_styles\Plugin\jsonapi\FieldEnhancer\ImageStyles::getOutputJsonSchema()

File

src/Plugin/jsonapi/FieldEnhancer/ImageStyles.php, line 156

Class

ImageStyles
Perform additional manipulations to timestamp fields.

Namespace

Drupal\consumer_image_styles\Plugin\jsonapi\FieldEnhancer

Code

public function getOutputJsonSchema() {
  return [
    'type' => 'object',
    'properties' => [
      'type' => [
        'type' => 'string',
      ],
      'id' => [
        'type' => 'string',
      ],
      'meta' => [
        'type' => 'object',
        'properties' => [
          'height' => [
            'type' => 'integer',
          ],
          'width' => [
            'type' => 'integer',
          ],
          'alt' => [
            'anyOf' => [
              [
                'type' => 'string',
              ],
              [
                'type' => 'null',
              ],
            ],
          ],
          'title' => [
            'anyOf' => [
              [
                'type' => 'string',
              ],
              [
                'type' => 'null',
              ],
            ],
          ],
          'links' => [
            'type' => 'object',
            'patternProperties' => [
              '.*' => [
                'type' => 'object',
                'properties' => [
                  'href' => [
                    'type' => 'string',
                    'format' => 'uri',
                  ],
                  'meta' => [
                    'type' => 'object',
                    'properties' => [
                      'rel' => [
                        'type' => 'array',
                        'items' => [
                          'type' => 'string',
                          'format' => 'uri',
                        ],
                      ],
                    ],
                  ],
                ],
              ],
            ],
          ],
        ],
      ],
    ],
  ];
}