{"id":20319597,"url":"https://github.com/augustmiller/kirby-json-transformer","last_synced_at":"2026-06-05T04:31:10.280Z","repository":{"id":71917954,"uuid":"78576222","full_name":"AugustMiller/kirby-json-transformer","owner":"AugustMiller","description":"A quick JSON API builder for Kirby resources","archived":false,"fork":false,"pushed_at":"2018-08-18T04:47:30.000Z","size":2,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T09:30:14.480Z","etag":null,"topics":["json","kirby","kirby-plugin"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AugustMiller.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-10T21:35:11.000Z","updated_at":"2018-08-18T04:47:32.000Z","dependencies_parsed_at":"2023-06-26T02:09:23.807Z","dependency_job_id":null,"html_url":"https://github.com/AugustMiller/kirby-json-transformer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AugustMiller/kirby-json-transformer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustMiller%2Fkirby-json-transformer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustMiller%2Fkirby-json-transformer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustMiller%2Fkirby-json-transformer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustMiller%2Fkirby-json-transformer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AugustMiller","download_url":"https://codeload.github.com/AugustMiller/kirby-json-transformer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustMiller%2Fkirby-json-transformer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33930307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["json","kirby","kirby-plugin"],"created_at":"2024-11-14T18:47:26.862Z","updated_at":"2026-06-05T04:31:10.266Z","avatar_url":"https://github.com/AugustMiller.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kirby JSON Transformer\n\nThe general goal here is to create a sort \"presentation and transformation layer\" for JSON a la [Fractal](http://fractal.thephpleague.com/), in Kirby.\n\nIt should accomplish a few things:\n\n- Make it easy to translate data structures defined in Blueprints into arrays that can be passed to `json_encode` or Kirby's `response::json` methods.\n- Expose \"resources\" or \"transformers\" to custom routes or [Content Representations](https://getkirby.com/docs/developer-guide/advanced/representations) with only a Blueprint's key\n- Offer out-of-the-box filterability for whitelisted attributes\n- Support an attribute blacklist for data that ought not be exposed\n- Provide query metadata\n- Have sane defaults or automatic behavior, but support extension when joins or more advanced/custom transformations are needed\n\nUltimately, passing data from the back- end to dynamic front-end components should be simpler— out-of-the-box, it requires a lot of boilerplate and basic attribute transformation (i.e. `$resource-\u003efield_name()-\u003etoString()`).\n\nAs mentioned above, the recent addition of [Content Representations](https://getkirby.com/docs/developer-guide/advanced/representations) are a great step, and the output of this plugin ough to be compatible with a basic `template.json.php` representation definition.\n\n# Notes\n\nI'll update this with ideas, until a time when past supporting work can be extracted and packaged into plugin.\n\n- Review [`JsonSerializable` interface](https://secure.php.net/JsonSerializable) to see if we couldn't shim this in without a plugin, i.e. via Kirby's custom page models:\n  ```php\n  class MyTemplatePage extends Page implements JsonSerializable {\n    public function jsonSerialize () { return [ /* ... */ ]; }\n  }\n  ```\n- What we're really describing here is a GraphQL extension. Is there any sense in replicating a great deal of that spec, when we might be able to shim in proper GraphQL support? Maybe a plugin exists already?\n\n:deciduous_tree:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugustmiller%2Fkirby-json-transformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faugustmiller%2Fkirby-json-transformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugustmiller%2Fkirby-json-transformer/lists"}