{"id":15077670,"url":"https://github.com/dimkinthepro/http-bundle","last_synced_at":"2026-03-07T23:01:42.725Z","repository":{"id":193894456,"uuid":"689690677","full_name":"dimkinthepro/http-bundle","owner":"dimkinthepro","description":"Request validation bundle for Symfony","archived":false,"fork":false,"pushed_at":"2024-09-04T16:27:26.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-08T03:47:56.082Z","etag":null,"topics":["ddd","php82","request-validation","symfony-bundle"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/dimkinthepro.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":"2023-09-10T15:57:18.000Z","updated_at":"2024-09-04T16:26:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"da9264e8-6a5b-4f4f-bae5-47c15ecde53f","html_url":"https://github.com/dimkinthepro/http-bundle","commit_stats":null,"previous_names":["dimkinthepro/http-bundle"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dimkinthepro/http-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimkinthepro%2Fhttp-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimkinthepro%2Fhttp-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimkinthepro%2Fhttp-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimkinthepro%2Fhttp-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimkinthepro","download_url":"https://codeload.github.com/dimkinthepro/http-bundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimkinthepro%2Fhttp-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30236043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"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":["ddd","php82","request-validation","symfony-bundle"],"created_at":"2024-09-25T04:06:32.293Z","updated_at":"2026-03-07T23:01:42.709Z","avatar_url":"https://github.com/dimkinthepro.png","language":"PHP","readme":"# Request validation bundle for Symfony\n\n### 1. Installation:\n```bash\ncomposer require dimkinthepro/http-bundle\n```\n\n### 2. Check bundles config:\n```php\n# config/bundles.php\n\nreturn [\n#...\n    Dimkinthepro\\Http\\DimkintheproHttpBundle::class =\u003e ['all' =\u003e true],\n];\n```\n\n### 3. Create bundle configuration:\n```yaml\n# config/packages/dimkinthepro_http.yaml\n\ndimkinthepro_http:\n    request_validation_enabled: true\n    extra_fields_allowed: true\n    handle_validation_errors: true\n    response_error_format: json\n```\n\n### 4. Check validator config:\n```yaml\n# config/packages/validator.yaml\n\nframework:\n    #...\n    validation:\n        #...\n        mapping:\n            paths:\n                #...\n                - '%kernel.project_dir%/config/validator/'\n```\n\n### 5. Create a controller DTO:\n```php\n# src/App/DTO/RequestDTO.php\n\nnamespace App\\DTO;\n\nuse Dimkinthepro\\Http\\Domain\\DTO\\ValidatedDTOInterface;\n\nclass RequestDTO implements ValidatedDTOInterface\n{\n    public string $method;\n    public int $parameter;\n    public \\DateTimeImmutable $date;\n    public App\\Enum\\FooEnum $enum;\n}\n```\n\n### 6. Create a validation config for DTO:\n```yaml\n# config/validator/RequestDTO.yaml\n\nApp\\DTO\\RequestDTO:\n  properties:\n    method:\n      - NotBlank: ~\n    parameter:\n      - NotBlank: ~\n      - GreaterThan: 0\n      - LessThanOrEqual: 255\n    date:\n      - NotBlank: ~\n    enum:\n      - NotBlank: ~\n```\n\n### 7. Use validated DTO in your controller:\n```php\n# src/App/Controller/Controller.php\n\nnamespace App\\Controller;\n\nuse App\\DTO\\RequestDTO;\nuse Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController;\nuse Symfony\\Component\\HttpFoundation\\JsonResponse;\n\nclass Controller extends AbstractController\n{\n    public function __invoke(RequestDTO $DTO): JsonResponse\n    {\n        return new JsonResponse([\n            'method' =\u003e $DTO-\u003emethod,\n            'parameter' =\u003e $DTO-\u003eparameter,\n            'date' =\u003e $DTO-\u003edate,\n            'enum' =\u003e $DTO-\u003eenum-\u003evalue,\n        ]);\n    }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimkinthepro%2Fhttp-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimkinthepro%2Fhttp-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimkinthepro%2Fhttp-bundle/lists"}