PHPackages                             awtyklo/carve-api - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. awtyklo/carve-api

ActiveLibrary[HTTP &amp; Networking](/categories/http)

awtyklo/carve-api
=================

Consistent and reusable way of composing REST API endpoints for Symfony

3.2.7(2mo ago)01.0k[2 issues](https://github.com/awtyklo/carve-api/issues)MITPHPPHP &gt;=8.5

Since Apr 17Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/awtyklo/carve-api)[ Packagist](https://packagist.org/packages/awtyklo/carve-api)[ RSS](/packages/awtyklo-carve-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (24)Versions (105)Used By (0)

Carve API
=========

[](#carve-api)

Consistent and reusable way of composing REST API endpoints for Symfony.

IMPORTANT! Work in progress.

Offers consistent and reusable way of composing REST API endpoints Allows single-minded endpoint customization Automatically generates OpenAPI documentation Introduces deny functionality to allow easier access control that includes feedback messages Adds layer of constraints that have REST API friendly messages

Build with:

- FOSRestBundle
- Symfony serializer
- OpenAPI

Branches
========

[](#branches)

You can use following branches:

1. `main` (default) - branch for current version `3.x` (Symfony 7.4)
2. `v2.x` - branch for version `2.x` (Symfony 6.4)
3. `v1.x` - branch for version `1.x` (Symfony 5.4)

Release
=======

[](#release)

Add new release on GitHub. It should be automatically synchronized by packagist. Remember to add tag when adding new release (i.e. `3.0.1`) as well.

Configuration
-------------

[](#configuration)

Add in `config/packages/doctrine.yaml`. It will enable storing `Types::DATETIME_MUTABLE` always in UTC timezone.

```
doctrine:
    dbal:
        types:
            datetime: Carve\ApiBundle\DBAL\Types\UTCDateTimeType
```

Add in `config/services.yaml`. It will override default FormErrorNormalizer to additionally pass parameters from error messages.

```
services:
    fos_rest.serializer.form_error_normalizer:
        class: Carve\ApiBundle\Serializer\Normalizer\FormErrorNormalizer
```

Add in `config/services.yaml`. It will override default ViewResponseListener to additionally handle exporting views.

```
services:
    fos_rest.view_response_listener:
        class: Carve\ApiBundle\EventListener\ViewResponseListener
```

Add in `config/packages/framework.yaml`. It will add default circular reference handling.

```
framework:
    serializer:
        circular_reference_handler: carve_api.serializer.circular_reference_handler
```

Modify `src/Kernel.php` to override `FormModelDescriber` class.

```
