<?php

namespace Drupal\dc_core\Controller;

use Drupal\dc_core\Attributes\LotrCharacterList;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Cache\CacheableJsonResponse;
use Symfony\Component\HttpFoundation\Response;

final class LotrCharacters extends ControllerBase {

  use LotrCharacterList;

  public function characterJson(): Response {
    /* return new Response(json_encode( */
    /*   $this->characterList, */
    /*   JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES */
    /* )); */
    return new CacheableJsonResponse($this->characterList);
  }
}
