Coder Social home page Coder Social logo

eosnewmedia / json-api-server-bundle Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 4.0 134 KB

The symfony integration for enm/json-api-server.

Home Page: https://eosnewmedia.github.io/JSON-API-Server-Bundle/

License: MIT License

PHP 100.00%
abstraction api api-server json json-api php php7 reusable symfony symfony-bundle

json-api-server-bundle's People

Contributors

bogomolov-dev avatar pmarien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

json-api-server-bundle's Issues

Request handlers: type vs generic

Request handlers with configured type and resource providers are always called before your generic handlers are called.

I don't see the implemented logic... The injected handler is the RequestHandlerChain, but at the execute function nothing handles the chain vs registry handler decision. Is this some future feature or just a bug?

Thanks for the bundle! It is a great tool to start with!

Symfony 5 support

Hi there!

Symfony 5 is out for some time, can you add support for it?

Also, i think in library should not be commited composer.lock...

Thanks!

Documentation lacking - Want to use this bundle but, frustrating

Hello,

This is quite a good bundle and i've been trying to use it over the course of a few days but, find the documentation seriously lacking when it comes to packaging up resources. Would it be possible to please add some further documentation on actual use cases or even an example project to follow with a particular emphasis on packaging data for transmission.

Right now, I've figured out creating JsonResource then returning it in a DocumentResponse which works fine for simple things but, i'm not even sure that's correct. How do i actually add relationships, etc.? I see lots of models to base things from but, there is no clear path on actual usage.

Is there a simpler way of achieving the following from the requesthandler for example?

// Use serializer to create simple resource
$travelPointSerialized = $this->serializer->toArray($travelPoint,
                SerializationContext::create()->setGroups(['Detail'])
        );
        $dataResource =  new JsonResource(
            'TravelPoints',
            $travelPoint->getId(),
            $travelPointSerialized
        );
        return new DocumentResponse($dataResource);  

How to define a resource ?

Hi,

I'm using symfony 4.

I have done :

  • composer require enm/json-api-server-bundle
  • this bundle registration (add Enm\Bundle\JsonApi\Server\EnmJsonApiServerBundle::class => ['all' => true] in config/bundles.php
  • configure routing (add in `config.routes.yaml)
json_api:
  resource: "@EnmJsonApiServerBundle/Resources/config/routing.xml"

On requesting /products (example) with

curl 127.0.0.1:8000/products -L -H 'Content-Type: application/vnd.api+json' -H 'Accept: application/vnd.api+json'

I have

Resource type \"products\" not found

What are resources ?

Regards,

PS : New to symfony, so probably a noob question ๐Ÿ˜

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.