PHPackages                             sci3ma/sf4-api-versioning - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sci3ma/sf4-api-versioning

ActiveProject[API Development](/categories/api)

sci3ma/sf4-api-versioning
=========================

Example of API versioning on Symfony Framework v4

001PHP

Since Mar 15Pushed 7y ago1 watchersCompare

[ Source](https://github.com/sci3ma/sf4-api-versioning)[ Packagist](https://packagist.org/packages/sci3ma/sf4-api-versioning)[ RSS](/packages/sci3ma-sf4-api-versioning/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

sf4-api-versioning
==================

[](#sf4-api-versioning)

Example of API versioning on Symfony Framework v4

Used additional bundles
-----------------------

[](#used-additional-bundles)

- friendsofsymfony/rest-bundle
- jms/serializer-bundle
- sci3ma/sf4grumphp (optional)

Steps to create project
-----------------------

[](#steps-to-create-project)

1. Create `Resource/config/api_routing.yaml` for controllers routes
2. Include `Resource/config/api_routing.yaml` into `config/routes.yaml`
    1. Add proper prefix with `version` parameter
    2. Add available/supported versions in `.env` file
3. Create Entity with properties:
    1. id
    2. name
    3. age
    4. color
4. Create Controller and define RESTful actions

Run project
-----------

[](#run-project)

1. Run build-in php server `bin/console server:start`
2. Go to:
    1. `[GET] 127.0.0.1:8000/api/v1.1/godzillas/1` and see response with properties:
        1. id
        2. name
        3. age
    2. `[GET] 127.0.0.1:8000/api/v1.2/godzillas/1` and see response with properties:
        1. id
        2. name
        3. age
        4. color
    3. `[GET] 127.0.0.1:8000/api/v1.3/godzillas/1` and see response with properties:
        1. id
        2. name
        3. age
        4. full\_name - which is virtual property
3. Similarly as example above:
    1. `[GET] http://127.0.0.1:8000/api/v1.1/godzillas`
    2. `[GET] http://127.0.0.1:8000/api/v1.2/godzillas`
    3. `[GET] http://127.0.0.1:8000/api/v1.3/godzillas`

Conclusion
----------

[](#conclusion)

The main goal of versioning api is changing/updating response structure with keeping the older version in the same time.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c747fc82d749649606874d8ca855a80ec40d7d06fe4b14ba275977c825cc78c3?d=identicon)[sci3ma](/maintainers/sci3ma)

---

Top Contributors

[![marcinharasim](https://avatars.githubusercontent.com/u/16610387?v=4)](https://github.com/marcinharasim "marcinharasim (2 commits)")

### Embed Badge

![Health badge](/badges/sci3ma-sf4-api-versioning/health.svg)

```
[![Health](https://phpackages.com/badges/sci3ma-sf4-api-versioning/health.svg)](https://phpackages.com/packages/sci3ma-sf4-api-versioning)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
