{"id":19291097,"url":"https://github.com/ongr-io/apibundle","last_synced_at":"2025-04-22T06:31:28.195Z","repository":{"id":29199402,"uuid":"32730682","full_name":"ongr-io/ApiBundle","owner":"ongr-io","description":"ONGR API Bundle","archived":false,"fork":false,"pushed_at":"2016-08-04T07:54:22.000Z","size":381,"stargazers_count":8,"open_issues_count":5,"forks_count":9,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-19T16:37:56.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ongr-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-23T12:24:09.000Z","updated_at":"2023-08-15T14:13:25.000Z","dependencies_parsed_at":"2022-08-17T19:41:07.017Z","dependency_job_id":null,"html_url":"https://github.com/ongr-io/ApiBundle","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ongr-io%2FApiBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ongr-io%2FApiBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ongr-io%2FApiBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ongr-io%2FApiBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ongr-io","download_url":"https://codeload.github.com/ongr-io/ApiBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250183182,"owners_count":21388671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T22:23:46.045Z","updated_at":"2025-04-22T06:31:28.179Z","avatar_url":"https://github.com/ongr-io.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ONGR Api Bundle\n\n\nApi Bundle allows rapid setup of RESTful API to simplify Elasticsearch data access for the remote clients.\n\n[![Build Status](https://travis-ci.org/ongr-io/ApiBundle.svg?branch=master)](https://travis-ci.org/ongr-io/ApiBundle)\n\nDocumentation\n\nThe source of the documentation is stored in the `Resources/doc/` folder in this bundle.\n\n[Read the API Bundle Documentation][2]\n\n\n## Setup the bundle\n\n\n\u003e This example assumes that you already have configured Elasticsearch bundle. \nIf you haven't, here's a quick [setup guide][3] on how to do it.\n\n### Step 1: Install\n\nApi bundle is installed using [Composer][4].\n\n```bash\ncomposer require ongr/api-bundle \"~1.0\"\n```\n\n### Step 2: Enable bundle in the AppKernel\n\n```php\n\u003c?php\n// app/AppKernel.php\n\npublic function registerBundles()\n{\n    $bundles = array(\n        // ...\n        new JMS\\SerializerBundle\\JMSSerializerBundle(),\n        new ONGR\\ElasticsearchBundle\\ONGRElasticsearchBundle(),\n        new ONGR\\ApiBundle\\ONGRApiBundle(),\n    );\n}\n```\n\n\u003e API Bundle requires JMS Serializer to work with JSON and XML\n\n### Step 3: Add configuration\n\nAdd minimal configuration for Api bundle to the `config.yml`.\n\n```yaml\n#app/config/config.yml\n\nongr_api:\n    default_encoding: json\n        versions:\n            v3:\n                endpoints:\n                    product:\n                        repository: es.manager.default.product\n```\n\n\u003e The example above shows a minimal configuration. To learn more take a look at the [configuration page][5].\n\n\nAdd routing\n\n```yaml\n#app/config/routing.yml\n\nongr_api_routing:\n    resource: @ONGRApiBundle/Resources/config/routing.yml\n    prefix: /api\n```\n\n\u003e You can specify prefix like you want, `api` is only the example.\n\n### Step 4: That's it\n\nIts ready to use. API Bundle will generate new url endpoints by your configuration, by previous configuration you will have: `\u003cyourdomain.com\u003e/api/v3/product`\n\n### What's next ?\n\nHead to [configuration page][5] to learn how to get most of your API or take a look at the [basic usage example][6]\n\n\n## License\n\nThis bundle is covered by the MIT license. Please see the complete license in the bundle [LICENSE][1] file.\n\n\n\n[1]: LICENSE\n[2]: Resources/doc/index.md\n[3]: https://github.com/ongr-io/ElasticsearchBundle/blob/master/README.md\n[4]: https://getcomposer.org/doc/00-intro.md\n[5]: Resources/doc/configuration.md\n[6]: Resources/doc/usage.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fongr-io%2Fapibundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fongr-io%2Fapibundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fongr-io%2Fapibundle/lists"}