{"id":15450535,"url":"https://github.com/sci3ma/sf4-api-versioning","last_synced_at":"2025-03-28T09:21:08.973Z","repository":{"id":62541198,"uuid":"175657887","full_name":"sci3ma/sf4-api-versioning","owner":"sci3ma","description":"Example of API versioning in Symfony Framework v4","archived":false,"fork":false,"pushed_at":"2019-03-15T07:27:25.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-02T09:46:05.821Z","etag":null,"topics":[],"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/sci3ma.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}},"created_at":"2019-03-14T16:17:23.000Z","updated_at":"2019-10-30T17:23:21.000Z","dependencies_parsed_at":"2022-11-02T15:32:58.268Z","dependency_job_id":null,"html_url":"https://github.com/sci3ma/sf4-api-versioning","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sci3ma%2Fsf4-api-versioning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sci3ma%2Fsf4-api-versioning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sci3ma%2Fsf4-api-versioning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sci3ma%2Fsf4-api-versioning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sci3ma","download_url":"https://codeload.github.com/sci3ma/sf4-api-versioning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245999651,"owners_count":20707575,"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":[],"created_at":"2024-10-01T21:06:08.609Z","updated_at":"2025-03-28T09:21:08.955Z","avatar_url":"https://github.com/sci3ma.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"sf4-api-versioning\n=================================================\nExample of API versioning on Symfony Framework v4\n\n\nUsed additional bundles\n-------------\n* friendsofsymfony/rest-bundle\n* jms/serializer-bundle\n* sci3ma/sf4grumphp (optional)\n\nSteps to create project\n------------------\n1. Create `Resource/config/api_routing.yaml` for controllers routes\n1. Include `Resource/config/api_routing.yaml` into `config/routes.yaml`\n    1. Add proper prefix with `version` parameter\n    1. Add available/supported versions in `.env` file\n1. Create Entity with properties:\n    1. id\n    1. name\n    1. age\n    1. color\n1. Create Controller and define RESTful actions\n\n\nRun project\n-----------\n1. Run build-in php server `bin/console server:start`\n1. Go to:\n    1. `[GET] 127.0.0.1:8000/api/v1.1/godzillas/1` and see response with properties:\n        1. id\n        1. name\n        1. age\n    1. `[GET] 127.0.0.1:8000/api/v1.2/godzillas/1` and see response with properties:\n        1. id\n        1. name\n        1. age\n        1. color \n    1. `[GET] 127.0.0.1:8000/api/v1.3/godzillas/1` and see response with properties:\n        1. id\n        1. name\n        1. age\n        1. full_name - which is virtual property\n1. Similarly as example above:\n    1. `[GET] http://127.0.0.1:8000/api/v1.1/godzillas`\n    1. `[GET] http://127.0.0.1:8000/api/v1.2/godzillas`\n    1. `[GET] http://127.0.0.1:8000/api/v1.3/godzillas`\n\n\nConclusion\n----------\nThe main goal of versioning api is changing/updating response structure with keeping the older version in the same time.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsci3ma%2Fsf4-api-versioning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsci3ma%2Fsf4-api-versioning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsci3ma%2Fsf4-api-versioning/lists"}