{"id":23900831,"url":"https://github.com/aerogo/api","last_synced_at":"2025-04-10T20:55:16.316Z","repository":{"id":57480414,"uuid":"93896414","full_name":"aerogo/api","owner":"aerogo","description":":triangular_ruler: Automatically implements your REST API.","archived":false,"fork":false,"pushed_at":"2019-10-26T06:39:55.000Z","size":102,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T11:37:25.925Z","etag":null,"topics":["api-server","go","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aerogo.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-06-09T20:59:31.000Z","updated_at":"2023-02-09T14:33:38.000Z","dependencies_parsed_at":"2022-09-26T17:41:41.437Z","dependency_job_id":null,"html_url":"https://github.com/aerogo/api","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerogo%2Fapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerogo%2Fapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerogo%2Fapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerogo%2Fapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aerogo","download_url":"https://codeload.github.com/aerogo/api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247452785,"owners_count":20941168,"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":["api-server","go","rest-api"],"created_at":"2025-01-04T20:39:40.885Z","updated_at":"2025-04-10T20:55:16.295Z","avatar_url":"https://github.com/aerogo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# api\n\n[![Godoc][godoc-image]][godoc-url]\n[![Report][report-image]][report-url]\n[![Tests][tests-image]][tests-url]\n[![Coverage][coverage-image]][coverage-url]\n[![Sponsor][sponsor-image]][sponsor-url]\n\nAutomatically implements your REST API.\n\n## Usage\n\n### Create an API instance\n\n```go\nmyAPI := api.New(\"/api/\", DB)\n```\n\nParameters:\n\n* The root of all your API routes\n* A database handle that fulfills the [Database](Database.go) interface\n\n### Install on an Aero app\n\n```go\nmyAPI.Install(app)\n```\n\nThis will register all API routes in the app.\n\n## Routes\n\nFor the following examples we'll assume you have the type `Movie` registered in the database and that your API root is `/api/`. Type names are automatically lowercased for all routes.\n\n### GET /api/movie/:id\n\nAction: `get`\n\nFetches the object with the given ID from the database and shows the JSON representation.\n\nExample response:\n\n```json\n\n```\n\nIf you need to filter out sensitive or private data you can implement the [Filter](Filter.go) interface on the data type.\n\n### POST /api/movie/:id\n\nAction: `edit`\n\nWrites new data to the object with the given ID. The data needs to be a JSON-formatted `map[string]interface` where each key stands for a [path to a field](https://github.com/aerogo/mirror#getproperty) of this object. The data type needs to implement the [Editable](Editable.go) interface. Editable fields must be whitelisted with the tag `editable` using the value `true`.\n\nExample request:\n\n```json\n\n```\n\nAlternate example using advanced key paths:\n\n```json\n\n```\n\n### POST /api/new/movie\n\nAction: `create`\n\nCreate a new object of that data type. The data type needs to implement the [Creatable](Creatable.go) interface to register that route. Usually the post body contains a JSON-formatted key/value map which is used as the initial data for the new object.\n\nExample request:\n\n```json\n\n```\n\nIt is up to the developer how the data is interpreted. This API library doesn't make any assumptions about the POST body in `create` requests.\n\n## Style\n\nPlease take a look at the [style guidelines](https://github.com/akyoto/quality/blob/master/STYLE.md) if you'd like to make a pull request.\n\n## Sponsors\n\n| [![Cedric Fung](https://avatars3.githubusercontent.com/u/2269238?s=70\u0026v=4)](https://github.com/cedricfung) | [![Scott Rayapoullé](https://avatars3.githubusercontent.com/u/11772084?s=70\u0026v=4)](https://github.com/soulcramer) | [![Eduard Urbach](https://avatars3.githubusercontent.com/u/438936?s=70\u0026v=4)](https://twitter.com/eduardurbach) |\n| --- | --- | --- |\n| [Cedric Fung](https://github.com/cedricfung) | [Scott Rayapoullé](https://github.com/soulcramer) | [Eduard Urbach](https://eduardurbach.com) |\n\nWant to see [your own name here?](https://github.com/users/akyoto/sponsorship)\n\n[godoc-image]: https://godoc.org/github.com/aerogo/api?status.svg\n[godoc-url]: https://godoc.org/github.com/aerogo/api\n[report-image]: https://goreportcard.com/badge/github.com/aerogo/api\n[report-url]: https://goreportcard.com/report/github.com/aerogo/api\n[tests-image]: https://cloud.drone.io/api/badges/aerogo/api/status.svg\n[tests-url]: https://cloud.drone.io/aerogo/api\n[coverage-image]: https://codecov.io/gh/aerogo/api/graph/badge.svg\n[coverage-url]: https://codecov.io/gh/aerogo/api\n[sponsor-image]: https://img.shields.io/badge/github-donate-green.svg\n[sponsor-url]: https://github.com/users/akyoto/sponsorship\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerogo%2Fapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faerogo%2Fapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerogo%2Fapi/lists"}