daves-weblab / rest-bundle

Bundle for creating REST Apis for Pimcore Objects for REST and JsonApi Json Standards.
3 stars 0 forks source link

Documentation #2

Open daves-weblab opened 6 years ago

daves-weblab commented 6 years ago

Write documentation with examples for code and configuration. Describe the core features like Normalizers, Denormalizers, Contexts and computed properties.

brainsbucket commented 5 years ago

Hi, thanks for this promising work !

Can you give us a quick start guide or a sample ?

when I add the bundle to composer.json, and execute composer update I have this error 👍

[RuntimeException]                                                                                                                                                                                                                                                         
  An error occurred when executing the "'cache:clear --no-warmup'" command:                                                                                                                                                                                                  

  Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\RuntimeException: Cannot autowire service "security.authentication.provider.guard.webservice.two_factor_decorator.inner": argument "$dataType" of method "DavesWeblab\RestBundle\Serializer\Seriali  
  zer::__construct()" references class "DavesWeblab\RestBundle\Data\DataType" but no such service exists. You should maybe alias this class to the existing "dwl.rest.data" service. in /var/www/clients/client1/web4/web/vendor/symfony/symfony/src/Symfony/Component/Depe  
  ndencyInjection/Compiler/DefinitionErrorExceptionPass.php:54                                                                                                                                                                                                               
  Stack trace:                                                                                                                                                                                                                                                               
  #0 /var/www/clients/client1/web4/web/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/AbstractRecursivePass.php(82): Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass->processValue(Object(Symfony\Component\Dependen  
  cyInjection\Definition), true)                                                                                                                                                                                                                                             
  #1 /var/www/clients/client1/web4/web/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/DefinitionErrorExceptionPa in /var/www/clients/client1/web4/web/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/DefinitionErrorE  
  xceptionPass.php on line 54 

Any suggestions ?

brainsbucket commented 5 years ago

I have added this to your service.yml and it work but I have only ID in the response...

  DavesWeblab\RestBundle\Data\DataType:
    class: DavesWeblab\RestBundle\Data\DataType
    public: true

  DavesWeblab\RestBundle\Factory\Factory:
    class: DavesWeblab\RestBundle\Factory\Factory
    public: true

  DavesWeblab\RestBundle\Config\Config:
    class: DavesWeblab\RestBundle\Config\Config
    public: true

  DavesWeblab\RestBundle\Serializer\Serializer:
    class: DavesWeblab\RestBundle\Serializer\Serializer
    public: true
brainsbucket commented 5 years ago

@daves-weblab I probably need to create a config file and put it somewhere in my service.yml.

Can you give me a small sample ?

Thanks