{"id":15026003,"url":"https://github.com/wol-soft/php-json-schema-model-generator-symfony-converter","last_synced_at":"2026-02-09T18:32:29.548Z","repository":{"id":57081600,"uuid":"246326681","full_name":"wol-soft/php-json-schema-model-generator-symfony-converter","owner":"wol-soft","description":"Provides a symfony converter for models generated with the wol-soft/php-json-schema-model-generator library","archived":false,"fork":false,"pushed_at":"2020-12-18T10:41:03.000Z","size":25,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-10T08:49:24.613Z","etag":null,"topics":["code-generation","injection","php-library","php72","php73","php74","symfony","symfony-bundle"],"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/wol-soft.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-03-10T14:42:50.000Z","updated_at":"2024-09-07T12:04:59.000Z","dependencies_parsed_at":"2022-08-24T14:42:48.885Z","dependency_job_id":null,"html_url":"https://github.com/wol-soft/php-json-schema-model-generator-symfony-converter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/wol-soft/php-json-schema-model-generator-symfony-converter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wol-soft%2Fphp-json-schema-model-generator-symfony-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wol-soft%2Fphp-json-schema-model-generator-symfony-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wol-soft%2Fphp-json-schema-model-generator-symfony-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wol-soft%2Fphp-json-schema-model-generator-symfony-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wol-soft","download_url":"https://codeload.github.com/wol-soft/php-json-schema-model-generator-symfony-converter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wol-soft%2Fphp-json-schema-model-generator-symfony-converter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29275614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T17:15:22.002Z","status":"ssl_error","status_checked_at":"2026-02-09T17:14:42.395Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["code-generation","injection","php-library","php72","php73","php74","symfony","symfony-bundle"],"created_at":"2024-09-24T20:03:29.887Z","updated_at":"2026-02-09T18:32:29.531Z","avatar_url":"https://github.com/wol-soft.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Version](https://img.shields.io/packagist/v/wol-soft/php-json-schema-model-generator-symfony-converter.svg)](https://packagist.org/packages/wol-soft/php-json-schema-model-generator-symfony-converter)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.2-8892BF.svg)](https://php.net/)\n[![Maintainability](https://api.codeclimate.com/v1/badges/940cde6f65ed06b3de69/maintainability)](https://codeclimate.com/github/wol-soft/php-json-schema-model-generator-symfony-converter/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/940cde6f65ed06b3de69/test_coverage)](https://codeclimate.com/github/wol-soft/php-json-schema-model-generator-symfony-converter/test_coverage)\n[![Build Status](https://travis-ci.com/wol-soft/php-json-schema-model-generator-symfony-converter.svg?branch=master)](https://travis-ci.com/wol-soft/php-json-schema-model-generator-symfony-converter)\n[![Coverage Status](https://coveralls.io/repos/github/wol-soft/php-json-schema-model-generator-symfony-converter/badge.svg?branch=master)](https://coveralls.io/github/wol-soft/php-json-schema-model-generator-symfony-converter?branch=master)\n[![MIT License](https://img.shields.io/packagist/l/wol-soft/php-json-schema-model-generator-symfony-converter.svg)](https://github.com/wol-soft/php-json-schema-model-generator-symfony-converter/blob/master/LICENSE)\n\n# php-json-schema-model-generator-symfony-converter\n\nProvides a symfony converter for models generated with the [wol-soft/php-json-schema-model-generator](https://github.com/wol-soft/php-json-schema-model-generator) library.\n\n## Requirements ##\n\n- Requires at least PHP 7.2\n- Requires the PHP extensions ext-json\n- Requires Symfony\n\n## Installation ##\n\nThe recommended way to install php-json-schema-model-generator-symfony-converter is through [Composer](http://getcomposer.org):\n```\n$ composer require wol-soft/php-json-schema-model-generator-symfony-converter\n```\n\n## Usage ##\n\nTo integrate models generated with the wol-soft/php-json-schema-model-generator library into your symfony project make sure you've added the `PHPModelGeneratorBundle` and the `SensioFrameworkExtraBundle` to your bundle configuration (eg. `config/bundles.php`):\n\n```php\n\u003c?php\n\nreturn [\n    Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle::class =\u003e ['all' =\u003e true],\n    Sensio\\Bundle\\FrameworkExtraBundle\\SensioFrameworkExtraBundle::class =\u003e ['all' =\u003e true],\n    PHPModelGenerator\\Bundle\\PHPModelGeneratorBundle::class =\u003e ['all' =\u003e true],\n];\n```\n\nAdditionally make sure converters are enabled eg. by creating a `config/packages/sensio_framework_extra.yaml` configuration file:\n\n```yaml\nsensio_framework_extra:\n  request:\n    converters: true\n    auto_convert: true\n```\n\nNow all you have to do is using the generated models in your controller action. The models will be instantiated automatically by utilizing the body of the request as data input. If an invalid request body is sent and the validation fails an Exception will be thrown. Register an exception listener and convert the exception into a feasible response. For a running example you can have a look into the demo application located in the tests of this library. It includes a JSON Schema (`tests\\App\\Schema\\person.json`), the generation step (`tests\\bootstrap.php`), an exception handler (`tests\\App\\Event\\ExceptionListener.php`) and a controller utilizing the generated model (`tests\\App\\Controller\\PersonController`).\n\n## Tests ##\n\nThe library is tested via [PHPUnit](https://phpunit.de/).\n\nAfter installing the dependencies of the library via `composer update` you can execute the tests with `./vendor/bin/phpunit` (Linux) or `vendor\\bin\\phpunit.bat` (Windows). The test names are optimized for the usage of the `--testdox` output.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwol-soft%2Fphp-json-schema-model-generator-symfony-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwol-soft%2Fphp-json-schema-model-generator-symfony-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwol-soft%2Fphp-json-schema-model-generator-symfony-converter/lists"}