6 ms·
Took a look at this some time ago, a few things you might like to know before diving deeper: OpenAPI support Developers seemed to oversee that there is an imp
by softwarelimits 7y ago
Took a look at this some time ago, a few things you might like to know before diving deeper:
OpenAPI support
Developers seemed to oversee that there is an important spec-first trend with building apis. Currently there is no way to generate code / models from OpenAPI spec, only generates documentation - so the statement about "OpenAPI integration" is only partially true.
Instead you have to fall back to legacy technique of manually coding models - this is bad for teams that adapted OpenAPI as their single source of truth. With this project you will have to maintain php code on api updates and it breaks any established spec-first OpenAPI roundtrip workflow.
Security
Very weak support for expected security out of the box - you need to implement Symfony based security ideas - if you have already done this and know that dark planet, go for it, if you have never seen that before be prepared for lots of awkwardness:
/**
* Secured resource.
*
* @ApiResource(
* attributes={"access_control"="is_granted('ROLE_USER')"},
* collectionOperations={
* "get",
* "post"={"access_control"="is_granted('ROLE_ADMIN')"}
* },
* itemOperations={
* "get"={"access_control"="is_granted('ROLE_USER') and object.owner == user"},
* "put"={"access_control"="is_granted('ROLE_USER') and previous_object.owner == user"},
* }
* )
* @ORM\Entity
*/
Yes, that is a PHP comment - Symfony uses comments for simulation of the non-existing language feature of annotations. Anybody who needs to make money in the Symfony universe follows that awkward and evil cult. Privately you will always hate it, but if all your team says "cool" you just shut up and accept it (and start looking for the next better job).
The whole security story with Symfony seems to be a horrible mess and after-thought, feels incredible tacked-on and will slowly grow into a maintenance nightmare. Badly maintained external libraries. Every software that uses it implements it in a different way.
But: because of large adaption in companies you will still find a solution for everything - be prepared for a long journey. You will end up with your very own solution and never be sure, if it is really secure - why did you want to use open source in the first place - was it for security reasons?
Interesting alternative security implementation:
https://medium.com/@ordermind/better-authorization-for-symfony-4-c958e9c6a410 https://medium.com/@ordermind/better-authorization-for-symfo...
Integration
This is just Symfony, so luckily you will find libraries for everything. However, it seems to be somehow detached from the current API product market, so there are some overlapping and not so obvious integration points with tools that help with API management. Note: this is not a complete api platform like the name suggests - many basic features for API management are missing. Developers should stop simulation of "no other software exists" and instead offer nice integration with some of the advanced api management tools.
Nice: GraphQL output only needs import of one library, no additional coding needed.
Support: Better learn french if you are using this to build your company on.
- esistgut 7y ago> Yes, that is a PHP comment - Symfony uses comments for simulation of the non-existing language feature of annotations. There is an RFC[1] for builtin annotation but no one seems to care. > Nice: GraphQL output only needs import of one library, no additional coding needed. The GraphQL output is forced to a relay compliant format. [1] https://wiki.php.net/rfc/annotations_v2 https://wiki.php.net/rfc/annotations_v2