{"id":15287232,"url":"https://github.com/nowiko/jsonrequestbundle","last_synced_at":"2025-06-21T09:05:04.821Z","repository":{"id":57029435,"uuid":"322663494","full_name":"nowiko/JsonRequestBundle","owner":"nowiko","description":"Bundle eases work with JSON requests and treats them as standard requests without using «crutches».","archived":false,"fork":false,"pushed_at":"2020-12-18T20:10:55.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-21T09:04:31.864Z","etag":null,"topics":["json-requests","jsonrequest-bundle","symfony"],"latest_commit_sha":null,"homepage":"","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/nowiko.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":"2020-12-18T17:36:30.000Z","updated_at":"2020-12-20T11:39:23.000Z","dependencies_parsed_at":"2022-08-23T18:50:09.565Z","dependency_job_id":null,"html_url":"https://github.com/nowiko/JsonRequestBundle","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nowiko/JsonRequestBundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowiko%2FJsonRequestBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowiko%2FJsonRequestBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowiko%2FJsonRequestBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowiko%2FJsonRequestBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nowiko","download_url":"https://codeload.github.com/nowiko/JsonRequestBundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowiko%2FJsonRequestBundle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261095302,"owners_count":23108782,"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":["json-requests","jsonrequest-bundle","symfony"],"created_at":"2024-09-30T15:27:02.483Z","updated_at":"2025-06-21T09:04:59.805Z","avatar_url":"https://github.com/nowiko.png","language":"PHP","readme":"[![Build Status](https://travis-ci.org/nowiko/JsonRequestBundle.svg?branch=master)](https://travis-ci.org/nowiko/JsonRequestBundle) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nowiko/JsonRequestBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/nowiko/JsonRequestBundle/?branch=master)\n\nJsonRequest Bundle\n=================================\n\nThis bundle is a copy (with some minor changes) of [JsonRequest Bundle](https://github.com/symfony-bundles/json-request-bundle) which, for some reasons, was deleted by authors.\n\nIt eases work with JSON requests and treats them as standard requests without using «crutches».\n\nInstallation\n------------\n1) Require the bundle with composer:\n``` bash\ncomposer require nw/json-request-bundle\n```\n\n2) Register the bundle in the application:\nIn `app/AppKernel.php` prior to Symfony version `4.0`:\n```php\npublic function registerBundles()\n{\n    $bundles = [\n        // ... ,\n        new NW\\JsonRequestBundle\\NWJsonRequestBundle()\n    ];\n\n    // ...\n    return $bundles;\n}\n```\n\nIn `config/bundles.php` when Symfony version is `4.0` and higher\n```php\nreturn [\n    //... other bundles\n    NW\\JsonRequestBundle\\NWJsonRequestBundle::class =\u003e ['all' =\u003e true]\n];\n```\n\nUsage\n------------\n\nPreviously to handle JSON-request, you were forced to do something similar to:\n``` php\npublic function indexAction(Request $request)\n{\n    $data = json_decode($request-\u003egetContent(), true);\n\n    // uses request data\n    $name = isset($data['name']) ? $data['name'] : null;\n}\n```\n\nWith this bundle you can work with JSON-request as with standard request:\n``` php\npublic function indexAction(Request $request)\n{\n    $name = $request-\u003eget('name');\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnowiko%2Fjsonrequestbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnowiko%2Fjsonrequestbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnowiko%2Fjsonrequestbundle/lists"}