gointegro / hateoas Goto Github PK
View Code? Open in Web Editor NEWYou already have a beautiful HATEOAS API. You just don't know it yet.
Home Page: http://www.gointegro.com/en/
License: MIT License
You already have a beautiful HATEOAS API. You just don't know it yet.
Home Page: http://www.gointegro.com/en/
License: MIT License
Hi Guys,
I'm receiving a ERROR_MALFORMED_SCHEMA exception when using a schema for my POST endpoint.
https://github.com/GoIntegro/hateoas/blob/master/JsonApi/Request/BodyParser.php#L217
^ Seems to expect the resource name to be an attribute (property) of the resource. http://json-schema.org/examples.html
Cheers.
The interface which sets the owner relation to the currently logged in user upon resource creation is not compatible with the owner being a parameter in the constructor, which is likely to be a common scenario.
I wonder if the permission constants in ParamEntityFinder, LinkedResourcesSerializer, and ResourceObjectSerializer could be changed to all upper case ('VIEW' instead of 'view'). This would make it compatible with the constants defined in BasicPermissionMap in the Symfony ACL system. That way, the ACL system (and the default permission map) could be used in combination with custom voters. In my use case, I'd like a few of the entity classes to be granted permission via the ACL, and others with custom voters. Thanks for considering this.
I installed the hateoas bundle for symfony2. I tried configuring myself, and then I tried the example bundle. In both cases, the following error is returned for any get request:
Catchable Fatal Error: Argument 4 passed to GoIntegro\Hateoas\JsonApi\Request\Parser::__construct() must be an instance of GoIntegro\Hateoas\JsonApi\Request\SortingParser, instance of GoIntegro\Hateoas\JsonApi\Request\PaginationParser given, called in G:\Content\Work\Website\wamp\www\sf2\app\cache\dev\appDevDebugProjectContainer.php on line 2082 and defined in G:\Content\Work\Website\wamp\www\sf2\vendor\gointegro\hateoas\GoIntegro\Hateoas\JsonApi\Request\Parser.php line 120 (500 Internal Server Error)
This library says it supports the JSON API specs, but as it seems not the current standard v1.0, or am I missing something?
According to the standard the primary resource should be put under the "data" key, but this implementation puts it under a key named like the resource type (see https://github.com/GoIntegro/hateoas/blob/master/JsonApi/DocumentSerializer.php#L83).
Other specs like putting resource fields under a "attributes" key, or using the "included" key to put related resources, seem to be not supported as well. So in general the JSON format seems to differ from the spec v1.0 substantially!
Which version is it based on then? Does not seem to be mentioned, and when is v1.0 support to be expected, if at all?
Given the RAML example, the linked GET examples should be "GET /users/1/links/posts" (not "linked"). When I made that change everything works as described.
I've also noticed that the example bundle defines a resource type ("collection") but then it doesn't actually use it in main api.raml file. This makes me wonder if resource types are still a work in progress. When I attempted to use the "collection" resource type on a resource I keep getting the following error: "The resource type declaration is neither a string nor a map." I might be doing something wrong, but if it's the case that resource types are not yet supported then it would be helpful it could please be noted in the docs (just to save us from spending too much time on trying to make it work before it's ready).
I realize I've been putting in issues without helping out by contributing any pull requests. I don't feel that confident using git just yet (sorry), but hopefully in future I might learn enough to be able to help. Thanks again for a fantastic bundle, very appreciated.
Hello,
In the GoIntegro\Bundle\HateoasBundle\Entity\DefaultBuilder.php
I noticed that you use Symfony\Component\Validator\Validator\ValidatorInterface
this interface was introduced in Symfony 2.5, and not supported by Symfony 2.3.
Would it be possible to use the Symfony\Component\Validator\ValidatorInterface
which is supported by Symfony 2.3?.
Until Symfony 2.7 is fully released in March 2015, Symfony 2.3 is the LTS version.
Kind regards,
Menzo.
Hello,
Great bundle! I have some minor problems which I can't find in the documentation.
In my User entity I defined some manyToMany and oneToMany relationships.
When I fetch a user object, I can't find them in de response JSON. When I try to fetch the user/expertise resource I get a 404 response.
While debugging I notice the fields are stored in a array called: dbOnly.
Class: GoIntegro\Bundle\HateoasBundle\Metadata\Resource\ResourceRelationships.php
I'm guessing you don't fetch the fields by default to save resources etc.
How can I retrieve the relations?
Kind Regards,
Menzo.
Edit:
Forgot to mention; also tried accessing the relationship resources like this:
http://application.dev/api/v1/users/3/links/expertise
Gives the following response:
"The requested relationship is undefined or can only be accessed through its own URL, filtering by its relationship with the current resource."
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.