Comments (10)
Hi! I don't think that it is a good idea to enable filtering at the framework level much more than what Yin now provides. In my opinion, Yin is only supposed to parse the filtering criteria from the request, and it's up to the application to actually use it in a DB query. Or did you mean something else?
from jsonapi-bundle.
PS : My code is publicly available https://github.com/waghanza/jsonapi-bundle-demo (my goal is to work with it as a base to improve jsonapi
support in php
from jsonapi-bundle.
Please take a look at this issue #5
from jsonapi-bundle.
👍 however, I do not understand the fact of having an external repo to enable filtering
for me filtering is already in the spec https://jsonapi.org/recommendations/#filtering
so it could be a work at yin level
what do you think ?
from jsonapi-bundle.
Probably we can share effort woohoolabs/yin#70
from jsonapi-bundle.
Nop. It was exactly my point (after reflexion)
Sure building has to be done in this bundle
from jsonapi-bundle.
Ah I see! 👍
from jsonapi-bundle.
The JSON APi specification is actually quite unclear on the exact implementation and states "The base specification is agnostic about filtering strategies supported by a server", meaning that it does not exactly include a clear set of rules that would result in minimal and capable filtering strategy.
The examples given are extremely limited and any more complex usage of the API will find it lacking. Searching by date for example is not covered.
I created a (very) simple bridge module between this bundle and RQL:
https://github.com/mnugter/jsonapi-rql-finder-bundle
It's a drop in solution which immediately provides you with the full RQL syntax, supporting nearly everything you'd want. If you're going to access your API form Javascript I would recommend the library https://github.com/persvr/rql. I created a fork with 2 other forks merged to fix some issues and enable webpack support.
That said, I would be in favor of having this library match the given examples in the basic filtering strategy to at least match the basic filtering capabilities. I'd be happy to review any PR.
from jsonapi-bundle.
@mnugter You're write the specification is not very strict
https://jsonapi.org/format/#fetching-filtering
However, a requesting method is recommanded and I find this quite clear in the perspective of writing the client part 😛
https://jsonapi.org/recommendations/#filtering
from jsonapi-bundle.
To be exact: the specification does not describe the stategy and functionality. The examples are very limited in functionality and to me not well thought through. It's a nice starting point and suggestion but nothing serious when considering an advanced and capable filtering strategy.
That said: I still think that implementing the basic examples is worthwhile.
from jsonapi-bundle.
Related Issues (20)
- Symfony 5 support
- include with specific attributes error not recognized HOT 1
- Default filtering HOT 3
- API prefix HOT 3
- Non nullable parameter in ValidatorTrait
- Bundle doesn't work with batch/subrequests
- Empty exist relationship [Question] HOT 2
- Does this bundle works with Doctrine ODM? HOT 1
- New tag for new feature HOT 1
- Error after generating API with Command HOT 1
- Create new release to allow use bundle in php 8 HOT 2
- orm-pack v2.1.0 HOT 1
- Target object does not arrive in queries HOT 1
- Disable pagination
- Unable to filter integer fields with % when getCount() is used HOT 7
- Transformer not generated HOT 2
- Argument 1 passed to PsrHttpFactory::createRequest() must be an instance of Request, null given HOT 1
- "Notice: Undefined index" when error is caused by `spl_autoload_call` function
- Not compatible with psr/http-message version 2.0 HOT 2
- Drop sensio/framework-extra-bundle dependency
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonapi-bundle.