Detail.

@return JsonResponse
766245
public function detailAction($id = null)
    {
        $media = $this->get('opifer.media.media_manager')->getRepository()->find($id);

        $media = $this->get('jms_serializer')->serialize($media, 'json', SerializationContext::create()->setGroups(['Default', 'detail']));

        return new JsonResponse(json_decode($media, true));
    }
993296
public function json()
    {
        $json = json_decode($this->getBody(), true);
        if ($json === null) {
            throw new RuntimeException(sprintf(
                "Can't decode response as JSON: %s",
                function_exists('json_last_error_msg')?
                    json_last_error_msg():
                    'Error code '.json_last_error()
            ));
        }
        return $json;
    }
999795
public function details() {
		return array_intersect_key(count($this->_details)?$this->_details:array(), array_flip($this->_public_details));
	}
370879
public function getInfo()
    {
        $json = (string) $this->client->request('GET', "/{$this->name}/")->getBody();

        return JSONEncoder::decode($json);
    }
564469
@Override
    public Map<String, Object> detail() {
        final Map<String, Object> details = super.detail();
        details.put("caption", caption);
        details.put("embed", embed);
        details.put("data", data);
        return details;
    }
792449
public function whoAmiSchemaAction()
    {
        /** @var Response $response */
        $response = $this->getResponse();
        $response->headers->set('Content-Type', 'application/json');

        $response->setContent(json_encode($this->getModel()->getSchema()));

        return $response;
    }
569889
public function query()
    {
        $sourceUUID = $this->getSourceUUID();
        if (empty($sourceUUID)) {
            return new JsonResponse([
                'status' => 'Error',
                'message' => 'Source UUID header must be defined',
            ], 400);
        }

        $authorUUID = $this
            ->userCredentialsProvider
            ->getUUID();

        $queryParameterBag = $this
            ->request
            ->query;

        $page = (int) $queryParameterBag->get('page', 1);
        $numPerPage = (int) $queryParameterBag->get('num_per_page', 10);
        $sortBy = json_decode($queryParameterBag->get(
            'sort_by',
            ['created_at' => 'desc']
        ), true);
        $indexedMetadataSortBy = [
            'indexed_metadata.' . key($sortBy) => $sortBy[key($sortBy)],
        ];

        $role = $this->userCredentialsProvider->isModerator()
            ? Author::ROLE_MODERATOR
            : Author::ROLE_USER;

        $result = $this
            ->commentRepository
            ->getCommentsBySource(
                $sourceUUID,
                $page,
                $numPerPage,
                $indexedMetadataSortBy,
                $role
            );

        if (!empty($authorUUID)) {
            foreach ($result->getComments() as $comment) {
                $this->setEditableInComment(
                    $comment,
                    $authorUUID
                );
            }
        }
        
        return new JsonResponse([
            'comments_result' => $result->toArray(),
            'user' => $this->userCredentialsProvider->toArray(),
        ], 200);
    }
931094
public function ajax(): JsonResponse
    {
        $transformer = app()->make('InetStudio\Comments\Contracts\Transformers\Back\CommentTransformerContract');

        return DataTables::of($this->query())
            ->setTransformer($transformer)
            ->rawColumns(['checkbox', 'read', 'active', 'material', 'actions'])
            ->make();
    }
220463
public function getInitial(): JsonResponse
    {
        $service = $this->getConfigService();

        if ($service->isAuthorized()) {
            return $this->response->success('OK', $service->getUserConfig());
        }

        return $this->response->success('OK', $service->getGuestConfig());
    }
480814
protected function toJson()
    {
        $serializedActionResults = [];

        foreach ($this->results as $action => $result) {
            $serializedActionResults[$action] = serialize($result);
        }

        $responseData = [
            'requestId' => $this->requestId,
            'actionResults' => $serializedActionResults
        ];

        return json_encode($responseData);
    }
911900
public function response()
    {
        $this->response = $this->client->send($this->request);

        return $this->response->json();
    }
1370424
public function detail($req)
    {
        $event = Event::get()->byID($req->param('ID'));
        if (!$event) {
            return $this->httpError(404);
        }
        return array(
            'Event'    => $event,
        );
    }
750692
public function toResponse()
    {
        $response = Http::getInstance()->response();
        $response->reset();
        $response->status($this->code);
        if (is_string($this->details)) {
            $response->body($this->details);
        } elseif (is_string($this->message)) {
            $response->body($this->message);
        }

        return $response;
    }
506595
public function explain()
    {
        $data     = $this->buildData();
        $response = $this->_connection->post(Urls::URL_EXPLAIN, $this->getConnection()->json_encode_wrapper($data), []);

        return $response->getJson();
    }
553871
public function getJson()
    {
        $response = [
            'status' => $this->status,
        ];

        switch ($this->status) {
            case self::STATUS_SUCCESS:
            case self::STATUS_FAIL:
                $response = array_merge(
                    $response,
                    [
                        'data' => $this->data,
                    ]
                );
                break;
            case self::STATUS_ERROR;
                $code     = $this->code ? ['code' => $this->code] : [];
                $data     = $this->data ? ['data' => $this->data] : [];
                $response = array_merge(
                    $response,
                    [
                        'message' => $this->message,
                    ],
                    $code,
                    $data
                );
                break;
            default:
                // because of the check in setStatus, this should never occur
                $response = [
                    'status'  => self::STATUS_ERROR,
                    'code'    => 500,
                    'message' => 'JSend response was built illegally',
                    'data'    => [
                        'original-data' => [
                            'status'  => $this->status,
                            'code'    => $this->code,
                            'message' => $this->message,
                            'data'    => $this->data,
                        ],
                    ],
                ];
                break;
        }

        return json_encode($response);
    }
35079
public function toJson()
    {
        $json = array();
        $json['id'] = $this->id;
        $json['from'] = $this->from;
        $json['color'] = $this->color;
        $json['message'] = $this->message;
        $json['notify'] = $this->notify;
        $json['message_format'] = $this->messageFormat;
        $json['date'] = $this->date;

        return $json;

    }
49523
public function indexAction()
    {
        $templates = $this->get('doctrine.orm.entity_manager')->getRepository('VictoireTemplateBundle:Template')->findByTemplate(null, ['position' => 'ASC']);

        return new JsonResponse(
            [
                'success' => true,
                'html'    => $this->container->get('templating')->render(
                    'VictoireTemplateBundle:Template:index.html.twig',
                    ['templates' => $templates]
                ),
            ]
        );
    }