{"id":20447231,"url":"https://github.com/stfalcon-studio/apibundle","last_synced_at":"2025-08-21T05:32:12.371Z","repository":{"id":36950990,"uuid":"257974142","full_name":"stfalcon-studio/ApiBundle","owner":"stfalcon-studio","description":":package: Base classes and helper services to build API application via Symfony.","archived":false,"fork":false,"pushed_at":"2024-07-24T10:01:07.000Z","size":356,"stargazers_count":10,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-20T06:48:45.148Z","etag":null,"topics":["api","bundle","php","rest","stfalcon","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"https://github.com/stfalcon-studio/ApiBundle","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/stfalcon-studio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"Security/AnonymousUser.php","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-22T17:36:13.000Z","updated_at":"2024-11-26T12:17:54.000Z","dependencies_parsed_at":"2024-01-02T08:42:19.908Z","dependency_job_id":"e2544dbc-9bf3-4d16-a2bc-c8d5b4d14fca","html_url":"https://github.com/stfalcon-studio/ApiBundle","commit_stats":{"total_commits":123,"total_committers":5,"mean_commits":24.6,"dds":0.3414634146341463,"last_synced_commit":"b8e7743193d3462d2ad9155da9f1c0e0f88646b6"},"previous_names":[],"tags_count":82,"template":false,"template_full_name":null,"purl":"pkg:github/stfalcon-studio/ApiBundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stfalcon-studio%2FApiBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stfalcon-studio%2FApiBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stfalcon-studio%2FApiBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stfalcon-studio%2FApiBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stfalcon-studio","download_url":"https://codeload.github.com/stfalcon-studio/ApiBundle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stfalcon-studio%2FApiBundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271430771,"owners_count":24758368,"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","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"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":["api","bundle","php","rest","stfalcon","symfony","symfony-bundle"],"created_at":"2024-11-15T10:25:16.140Z","updated_at":"2025-08-21T05:32:11.821Z","avatar_url":"https://github.com/stfalcon-studio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ApiBundle\n\n:package: Base classes and helper services to build API application via Symfony.\n\n[![Scrutinizer Quality Score](https://img.shields.io/scrutinizer/g/stfalcon-studio/ApiBundle.svg?style=flat-square)](https://scrutinizer-ci.com/g/stfalcon-studio/ApiBundle/)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/stfalcon-studio/ApiBundle/ci.yaml?branch=main\u0026style=flat-square)](https://github.com/stfalcon-studio/ApiBundle/actions?query=workflow%3ACI+branch%3Amain+)\n[![CodeCov](https://img.shields.io/codecov/c/github/stfalcon-studio/ApiBundle.svg?style=flat-square)](https://codecov.io/github/stfalcon-studio/ApiBundle)\n[![License](https://img.shields.io/packagist/l/stfalcon-studio/api-bundle.svg?style=flat-square)](https://packagist.org/packages/stfalcon-studio/api-bundle)\n[![Latest Stable Version](https://img.shields.io/packagist/v/stfalcon-studio/api-bundle.svg?style=flat-square)](https://packagist.org/packages/stfalcon-studio/api-bundle)\n[![Total Downloads](https://img.shields.io/packagist/dt/stfalcon-studio/api-bundle.svg?style=flat-square)](https://packagist.org/packages/stfalcon-studio/api-bundle)\n[![StyleCI](https://styleci.io/repos/257974142/shield?style=flat-square)](https://styleci.io/repos/257974142)\n\n## Installation\n\n```\ncomposer req stfalcon-studio/api-bundle\n```\n\nAdd next dependencies if you want to use JWT auth\n\n```\ncomposer req gesdinet/jwt-refresh-token-bundle\ncomposer req lexik/jwt-authentication-bundle\n```\n\n#### Check the `config/bundles.php` file\n\nBy default, Symfony Flex adds this bundle to the `config/bundles.php` file.\nIn case when you ignored `contrib-recipe` during bundle installation it would not be added. In this case add the bundle manually.\n\n```php\n# config/bundles.php\n\nreturn [\n    // Other bundles...\n    StfalconStudio\\ApiBundle\\StfalconApiBundle::class =\u003e ['all' =\u003e true],\n    // Other bundles...\n];\n```\n\n## Set Up Steps\n\n#### Add mappings to Doctrine ORM config\n\n```yaml\ndoctrine:\n  orm:\n    mappings:\n      StfalconApiBundle: ~\n```\n\n#### Set up a directory for JSON schemas\n\nThe default directory is `./src/Json/Schema/`. Or you can change it via bundle configuration.\n\n```yaml\nstfalcon_api:\n  api_host: '%env(APP_API_HOST)%'\n  json_schema_dir: '%kernel.project_dir%/src/Json/Schema/'\n  jwt:\n    enabled: true # set false to disable JWT auth \n    redis_client_jwt_black_list: \"@snc_redis.jwt_black_list\"\n```\n\n# Usage\n## Dictionary enums\nFor simple dictionary enums, you can use the `DictionaryEnumInteface` interface on Enums.\nIt will register for serialization like a dictionary, so the result will be like:\n```json\n{\n  \"id\": 1,\n  \"value\": \"Enum name\"\n}\n```\n\nSo, now the dictionary action will look like:\n```php\n#[Route(path: '/foo/bar', name: 'foo_bar', methods: [Request::METHOD_GET])]\npublic function __invoke(): JsonResponse\n{\n    // ...\n\n    return new JsonResponse(data: $this-\u003eserializer-\u003eserialize(FooBar::cases()), json: true);\n}\n```\n\nIn some cases, you may need to serialise dictionary value not as dictionary, for this just add in context parameter `default_normalization` with any value.\n```php\n$this-\u003eserializer-\u003eserialize($fooBar, 'json', ['default_normalization' =\u003e true]);\n```\n\n## Contributing\n\nRead the [CONTRIBUTING](https://github.com/stfalcon-studio/ApiBundle/blob/main/.github/CONTRIBUTING.md) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstfalcon-studio%2Fapibundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstfalcon-studio%2Fapibundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstfalcon-studio%2Fapibundle/lists"}