PHPackages                             netlogix/webapi - 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. netlogix/webapi

ActiveNeos-package[API Development](/categories/api)

netlogix/webapi
===============

Create jsonapi.org web apis in flow

3.0.1(3w ago)0297.6k↑64.5%MITPHPCI passing

Since Jan 29Pushed 3w ago5 watchersCompare

[ Source](https://github.com/netlogix/Netlogix.WebApi)[ Packagist](https://packagist.org/packages/netlogix/webapi)[ Docs](http://websolutions.netlogix.de/)[ RSS](/packages/netlogix-webapi/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (12)Versions (22)Used By (0)

Netlogix.WebApi
===============

[](#netlogixwebapi)

Installation
------------

[](#installation)

`composer require netlogix/webapi`

Accept-header driven exception handling
---------------------------------------

[](#accept-header-driven-exception-handling)

The package ships a PSR-15 middleware that catches exceptions inside the middleware chain and turns them into a `ResponseInterface`. This way, any response-decorating middleware (most importantly `Sitegeist.OffCORS:CorsMiddleware`) sees a real response on errors and can add its headers — which the default Flow exception path, running through `set_exception_handler`, would bypass.

### Components

[](#components)

- `Netlogix\WebApi\Http\Middleware\ExceptionToResponseMiddleware`Catches any `Throwable` thrown by downstream middlewares and delegates rendering to the dispatcher below. Registered via `Configuration/Settings.Middleware.yaml` directly after `Sitegeist.OffCORS:CorsMiddleware`.
- `Netlogix\WebApi\Error\AcceptHeaderDependingExceptionHandler`Picks one of the configured Flow `ExceptionHandlerInterface`implementations based on the request's `Accept` header (proper content negotiation via `Neos\Flow\Http\Helper\MediaTypeHelper`), invokes it, and adapts its `header()` / `echo` style output into a PSR-7 response.
- `Netlogix\WebApi\Error\JsonExceptionHandler`Renders the throwable as a jsonapi.org-style error document (`{"errors": [{…}]}`) mirroring the shape produced by `Netlogix\JsonApiOrg\Controller\ApiController::errorAction()`. For plain throwables the entry carries `code` and `title`, plus an optional `id` from `WithReferenceCodeInterface`. Production-safe variant — does not publish the exception message.
- `Netlogix\WebApi\Error\JsonDebugExceptionHandler`Same envelope as `JsonExceptionHandler`, but for plain throwables the error entry additionally carries `detail` (the exception message) and a `meta` block with `exceptionType`, `file`, `line`, a sanitized `trace` (frame args stripped) and a recursive `meta.previous` chain — analogous to how `Neos\Flow\Error\DebugExceptionHandler` extends the `ProductionExceptionHandler`. Reserved for non-production contexts.

Exceptions implementing `JsonSerializable` provide the **body of one error entry** (the jsonapi.org fields, e.g. `code` / `title` / `detail` / `meta`). Both handlers wrap that body in the standard `{"errors": […]}` envelope, so the exception decides its own representation but never the response shape.

### Configuration

[](#configuration)

Configure renderers per media type under `Netlogix.WebApi.error.availableErrorHandlers`. The shape of the `options` entry mirrors Flow's own `Neos.Flow.error.exceptionHandler`(`defaultRenderingOptions`, `renderingGroups`, …), so the values can be copy-pasted between the two.

```
Netlogix:
  WebApi:
    error:
      availableErrorHandlers:
        'application/vnd.api+json':
          className: 'Netlogix\WebApi\Error\JsonExceptionHandler'
        'application/json':
          className: 'Netlogix\WebApi\Error\JsonExceptionHandler'
        '*':
          className: 'Neos\Flow\Error\ProductionExceptionHandler'
          options:
            defaultRenderingOptions:
              renderTechnicalDetails: false
              logException: true
```

- Keys are IANA media types; the request's `Accept` header is negotiated against them, respecting q-values and `*/*` ranges.
- The special key `*` is the fallback used when no configured media type matches the request's preferences. If `*` is missing and nothing else matches, the exception escapes back to Flow's `set_exception_handler` chain.
- The shipped `Configuration/Development/Settings.ExceptionHandler.yaml`swaps every renderer for its debug counterpart: `Neos\Flow\Error\DebugExceptionHandler` for the `*` fallback and `Netlogix\WebApi\Error\JsonDebugExceptionHandler` for both JSON media types — mirroring how Flow itself replaces the production handler with the debug variant in Development.

### Logging

[](#logging)

Logging is delegated entirely to the resolved Flow `ExceptionHandler`(`logException` in its rendering options drives `ThrowableStorage`); the middleware itself does not log.

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance94

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 71.7% 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.

###  Release Activity

Cadence

Every ~140 days

Recently: every ~155 days

Total

15

Last Release

22d ago

Major Versions

1.2.0 → 2.0.02024-02-12

2.3.1 → 3.0.02026-05-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/667b5107f4c2ea180baa00166c2ee3f2a1b412ce22768d6e81bb09323d1c7fe0?d=identicon)[netlogix](/maintainers/netlogix)

![](https://www.gravatar.com/avatar/124704a0d41c6364ac5773df0c9bedc3a85f902f0826df5f12ff2a4b2a06d520?d=identicon)[paxuclus](/maintainers/paxuclus)

---

Top Contributors

[![paxuclus](https://avatars.githubusercontent.com/u/15905038?v=4)](https://github.com/paxuclus "paxuclus (38 commits)")[![stephanschuler](https://avatars.githubusercontent.com/u/1595908?v=4)](https://github.com/stephanschuler "stephanschuler (14 commits)")[![HenrikVogel](https://avatars.githubusercontent.com/u/183506026?v=4)](https://github.com/HenrikVogel "HenrikVogel (1 commits)")

### Embed Badge

![Health badge](/badges/netlogix-webapi/health.svg)

```
[![Health](https://phpackages.com/badges/netlogix-webapi/health.svg)](https://phpackages.com/packages/netlogix-webapi)
```

###  Alternatives

[neos/neos

An open source Content Application Platform based on Flow. A set of core Content Management features is resting within a larger context that allows you to build a perfectly customized experience for your users.

1151.0M777](/packages/neos-neos)[neos/media

The Media package

101.2M53](/packages/neos-media)[neos/neos-development-collection

Neos packages in a joined repository for pull requests.

267103.9k1](/packages/neos-neos-development-collection)[flowpack/elasticsearch-contentrepositoryadaptor

This package provides functionality for using Elasticsearch on top of Neos.ContentRepository.Search

42398.4k10](/packages/flowpack-elasticsearch-contentrepositoryadaptor)[wwwision/graphql

Base package to create GraphQL endpoints with Flow

2116.2k1](/packages/wwwision-graphql)

PHPackages © 2026

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