You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Oli, kudos for a job well done! I have a question regarding standalone usage.
Let's assume that I have my router that takes Symfony\Component\HttpFoundation\Request and returns Symfony\Component\HttpFoundation\Response. Can you please tell me how can I can achieve something like that:
<?php
use Jad\Jad;
use Jad\Map\AnnotationsMapper;
use Jad\Request\JsonApiRequest;
use Jad\Request\Parameters;
use Jad\Response\JsonApiResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class JsonApiRouter
{
public function __invoke(Request $request): Response
{
$parameters = new Parameters();
$parameters->setArguments($request->query->all());
$mapper = new AnnotationsMapper($this->getEm());
$jsonApiRequest = new JsonApiRequest($request, $parameters);
$jsonApiRequest->setPathPrefix('/json');
$response = new JsonApiResponse($jsonApiRequest, $mapper);
return $response->getRawResponse(); // this is what I miss :)
}
}
The text was updated successfully, but these errors were encountered:
Hi, thank you for reaching out, sorry for late reply. This is not available at this time but basically what you want is the the document json encoded I guess. If you are up for it, a PR would be appreciated, otherwise I can look at it later.
Description
Hi Oli, kudos for a job well done! I have a question regarding standalone usage.
Let's assume that I have my router that takes Symfony\Component\HttpFoundation\Request and returns Symfony\Component\HttpFoundation\Response. Can you please tell me how can I can achieve something like that:
The text was updated successfully, but these errors were encountered: