ongr-io / apibundle Goto Github PK
View Code? Open in Web Editor NEWONGR API Bundle
License: MIT License
ONGR API Bundle
License: MIT License
This controller has to implement: https://github.com/ongr-io/ApiBundle/blob/master/Resources/doc/endpoints.md#get-all-documents
There is not clear task how it should be done. So we need to do a little research here.
All the details and proposals lets discuss here.
This controller has to implement https://github.com/ongr-io/ApiBundle/blob/master/Resources/doc/endpoints.md#multiple-insert
Also array keys in controller array should be changed to more intuitive. Instead of
controller:
controller: AcmeTestBundle:CustomApi
could be, for example:
controller:
name: AcmeTestBundle:CustomApi
Could we add the pretty parameter to format the output. That would be very helpful for debugging.
If the endpoint has enabled batch option we should let import multiple documents for a single type via bulk. Investigate and implement it.
Currently Elasticsearch bundle is in the alpha stage, but it's already more or less stable. So its about time to make sure it will work well with new version.
Probably RabbitMQ
Response should be sent immediately regarding if batch is complete or not. Status code should be 202.
It could be useful if request is large.
See here
When defining endpoint with custom controller manager
and document
still must be set but controller might not need those.
Look at the configuration docs: https://github.com/ongr-io/ApiBundle/blob/9610b53ea5bc7dd3390b4be27e7a94452a3e4cb8/Resources/doc/configuration.md
Say we have:
ongr_api:
output_format: json
version_in_url: true
versions:
v3:
endpoints:
person:
repository: es.manager.default.person
allow_extra_fields: false
allow_get_all: true
Routes we expect to have generated dynamicaly:
/api/v1/person POST
/api/v1/person/{id} PUT
/api/v1/person/{id} GET
/api/v1/person/_all GET
/api/v1/person/{id} DELETE
/api/v1/person/_batch POST
Routes must be pointed to specific RestController
action.
e.g. product/100/items
Unknown fields should have index=not_analyzed
.
Should handle batch api, provide user friendly error handling.
Do we need those classes to generate routes?
Blocks #94
Endpoint overriding with default values should be possible.
Forms now are used for validate documents. Exchange it with symfony/validator
or something more reliable. Symfony forms IMO is worst choice.
Parent endpoint must not be changed while appending its config, since parent itself is not always processed before child.
Router should search a match of generated API endpoint service by version and name.
Check if document and manager exists
We should require format: application/vnd.ongr.v3+json
Remove: AbstractCollectionController, CollectionController, CollectionControllerInterface
We will create for _batch
and _all
standalone controllers.
Basicaly it means there is a need to support relations for any document. I'm not so sure if that is reasonable to support it natively in API bundle. It's too complex to be tied to a products or some other domain. Curently we are trying to make it more universal version where we can provide an easy way to use Restful API for elasticsearch.
We need to test:
Find a way how to filter routes in BatchController.
Now hardcoded:
ApiBundle/Request/BatchProcessor.php
Line 64 in c56579a
Provide standard support for CRUD actions.
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.