Category : api-platform.com

I have an entity and a DTO that I would like to use in POST requests. Here are my two classes. <?php declare(strict_types=1); namespace AppEntity; use ApiPlatformCoreAnnotationApiResource; use AppDtoTestPost; /** * @ApiResource( * collectionOperations={ * "post"={ * "input"=TestPost::class * } * }, * itemOperations={} * ) */ final class Test { public string $foo; public ..

Read more

I have this array which i get from somewhere: array:1 [ "content" => array:2 [ 0 => array:4 [ "accountBalanceCode" => "40000" "accountBalanceType" => "W" "accountBalanceDescription" => "Salarissen" "accountBalanceAmount" => "1000.00" ] 1 => array:4 [ "accountBalanceCode" => "80000" "accountBalanceType" => "W" "accountBalanceDescription" => "Omzet" "accountBalanceAmount" => "-1000.00" ] ] ] I also have this ..

Read more

This question is a follow up to how to link http client with ApiResource I have client which retrieves xml data and it converts it in to associative array: <?php namespace AppHttp; use AppEntityGLAccountBalance; use SimpleXMLElement; use SymfonyComponentSerializerEncoderJsonEncoder; use SymfonyComponentSerializerNormalizerArrayDenormalizer; use SymfonyComponentSerializerNormalizerGetSetMethodNormalizer; use SymfonyComponentSerializerNormalizerObjectNormalizer; use SymfonyComponentSerializerSerializer; use SymfonyComponentSerializerSerializerInterface; use SymfonyContractsHttpClientHttpClientInterface; class GetYukiAccountingBalance implements GetYukiAccountingBalanceInterface { ..

Read more

I have a client which gets xml and converts it to associative array: class GetYukiAccountingBalance implements GetYukiAccountingBalanceInterface { /** * @var HttpClientInterface */ public static $balance; public static $succesfulResponse; public static $glAccountBalanceArray; private $httpClient; private const YUKI_API_URL = ‘https://api.yukiworks.nl/ws/Accounting.asmx/GLAccountBalance’; private const YUKI_API_HOST = ‘https://api.yukiworks.nl’; private $yukiApiKey; public function __construct(HttpClientInterface $httpClient, SerializerInterface $serializer, $yukiApiKey) { $this->httpClient ..

Read more

I have entity with ApiResource format xml. I want to download generated xml as file by default. Should i override response headers Content-Disposition – if yes, how can i do? Or there is other way to do it? Entity <?php namespace AppEntityJpk; use ApiPlatformCoreAnnotationApiProperty; use ApiPlatformCoreAnnotationApiResource; /** * @ApiResource( * formats={"xml"}, * itemOperations={ * "get" ..

Read more