{"id":36982437,"url":"https://github.com/delkano/f3-jsonapi","last_synced_at":"2026-01-13T22:52:23.431Z","repository":{"id":56965136,"uuid":"111535968","full_name":"delkano/f3-jsonapi","owner":"delkano","description":"A few helpful classes to implement a JsonAPI server using the FatFreeFramework and F3-Cortex","archived":false,"fork":false,"pushed_at":"2021-10-21T10:41:35.000Z","size":37,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-03-30T08:21:45.818Z","etag":null,"topics":["f3","f3-jsonapi","jsonapi-server","php"],"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/delkano.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-11-21T10:46:46.000Z","updated_at":"2024-03-30T08:21:45.819Z","dependencies_parsed_at":"2022-08-21T10:20:24.784Z","dependency_job_id":null,"html_url":"https://github.com/delkano/f3-jsonapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/delkano/f3-jsonapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delkano%2Ff3-jsonapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delkano%2Ff3-jsonapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delkano%2Ff3-jsonapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delkano%2Ff3-jsonapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delkano","download_url":"https://codeload.github.com/delkano/f3-jsonapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delkano%2Ff3-jsonapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28402172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["f3","f3-jsonapi","jsonapi-server","php"],"created_at":"2026-01-13T22:52:22.962Z","updated_at":"2026-01-13T22:52:23.418Z","avatar_url":"https://github.com/delkano.png","language":"PHP","readme":"# F3-JsonAPI\n\n## Introduction\nI've had to write a few JsonAPI servers and, at some point, I've started to distil all the common code into a separate class. This is still a work in progress and will be for a while, since it is both my first library and a rewrite of those common classes I was talking about; but it should be operative.\n\n## Use\n\n### Dependencies\nf3-jsonapi is a [FatFreeFramework](https://fatfreeframework.com/) plugin. These instructions assume you are working in a FatFreeFramework project.\n\nIn addition, you need to have [F3-Cortex](https://github.com/ikkez/f3-cortex) installed and configured.\n\n### Installation\nYou can install f3-jsonapi in your project with:\n\n    composer require delkano/f3-jsonapi\n\n### Configuration\nThen list all your models into your config.ini\n\n    [models]\n    \u003cplural\u003e=\u003cModel\u003e\n\nDefine each model in the namespace `Model`, using F3-Cortex for this, and finally call the setup method in your index.php before `$f3-\u003erun()`:\n\n    JsonApi::setup();\n\nI have added to the F3-Cortex model definition one attribute for the 'has-many' relationships. If you add\n\n    'async' =\u003e true,\n\nthe relationship won't be detailed inline. This is useful for very large relationships.\n\nYou don't need to define any controllers, since each model is assigned the `readable` controller by default. However, if you want to customize the behaviour, you can extend any of the provided base controllers  (`JsonApi`, `Readable` and `Restricted`) and override their methods.\n\nFor ease of editing, there are some hooks provided:\n\n    processInput\n    postSave\n    processSingleQuery\n    processListQuery\n    orderRelationship\n\nI will write some documentation for them, but for now you can check the JsonApi controller code to see their working.\n\n## Current status\n\n  * Base controller works\n  * Readable controller, for those objects that can only be edited by their creators but publicly read\n  * Restricted controller, for those objects that can only be accessed by their creators\n  * The fallback controller, which is assigned to any models without an explicit controller, defaults to Readable\n  * Setup is written\n  * Needs testing\n\nAlthough F3-JsonAPI is to be considered under development, I have been using it for my own projects for some time and it is stable and working.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelkano%2Ff3-jsonapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelkano%2Ff3-jsonapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelkano%2Ff3-jsonapi/lists"}