Download the PHP package openapi-tools/generator-psr-15-webhook-middleware without Composer

On this page you can find all versions of the php package openapi-tools/generator-psr-15-webhook-middleware. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package generator-psr-15-webhook-middleware

generator-psr-15-webhook-middleware

FileGenerator for OpenAPI Tools that emits a PSR-15 webhook middleware stack: an enum-backed resolver, custom hydrator, and public middleware. When entryPoints.webHookMiddleware is enabled, it replaces the public WebHooks entry point and EventSauce webhook hydrators for that mode.

Continuous Integration Latest Stable Version Total Downloads License

Installation

Where it fits

This package runs after gatherer has built a representation and generator-schema has emitted payload schema classes. Register WebHookMiddleware when middleware mode is enabled; set includeWebHookHydrators: false on generator-hydrator so webhook hydration is owned here instead.

Example

The snippet below is generated by running the webhook middleware generator against a real OpenAPI input when you run make generate-readme. The example driver lives in etc/docs/README.php.

Input — OpenAPI webhooks (example-input.yaml):

Output

Running gatherer + WebHookMiddleware::generate() against the input above emits these files. The spec defines four webhooks: healthCheck and inventoryUpdate are resolved by matching headers (and field fingerprints); petLifecycle and storePolicy use an Event enum with discriminator match on eventType and action. All resolution lives in Internal\WebHook\WebHooks: src/Internal/WebHook/Hydrator.php

src/Internal/WebHook/Event.php

src/Internal/WebHook/WebHooks.php

src/WebHookMiddleware.php

For each payload variant in the spec, the generator emits:

Class Visibility
WebHookMiddleware Public
Internal\WebHook\WebHooks Internal — enum match for discriminators, header matching fallback otherwise
Internal\WebHook\Event Internal — one enum case per payload variant
Internal\WebHook\Hydrator Internal
Internal\WebHook\InvalidWebHookRequestException Internal

Schema classes (Schema\Ping, Schema\Push, …) are still emitted by generator-schema.

Resolution order

For each webhook delivery, generated code resolves the payload in this order:

  1. Headers — match declared webhook header parameters (e.g. X-Event-Type)
  2. Discriminator — when the spec defines discriminator, match $data[$propertyName]
  3. Field fingerprint — required fields must be present in $data
  4. Validation — SchemaValidator against generated SCHEMA_JSON
  5. Hydration — Internal\WebHook\Hydrator maps arrays to readonly schema objects (no EventSauce)

Behaviour

Usage in openapi-client-generator

Or with explicit paths (overridable at runtime via the middleware constructor):

When middleware mode is enabled, webHooks: true is implied but the public WebHooks / WebHook generators are not registered.

Implement OpenAPITools\Contract\WebHookHandlerInterface to handle resolved payloads:

Wire the middleware in your HTTP application:

In a full client package, WebHookMiddleware is wired into the generator run loop alongside other FileGenerator implementations. A minimal direct invocation looks like this:

See openapi-tools/generator for a complete package configuration.

Related packages

Package Relationship
contract FileGenerator, WebHookHandlerInterface, and Package interfaces
representation Input model consumed by this generator
gatherer Builds the representation from OpenAPI
generator-schema Emits payload schema classes this generator hydrates
generator-hydrator Disable webhook hydrators when this package is active
generator-utils AST builders used by this generator
generator CLI and run loop that orchestrates all generators

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT)

Copyright (c) 2026 Cees-Jan Kiewiet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of generator-psr-15-webhook-middleware with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-json Version ^8.4
devizzent/cebe-php-openapi Version ^1.1.5
league/openapi-psr7-validator Version ^0.21.0
nikic/php-parser Version ^5.0
openapi-tools/contract Version ^0.1.0
openapi-tools/generator-utils Version ^0.1.0
openapi-tools/representation Version ^0.1.0
openapi-tools/utils Version ^0.1.0
psr/http-message Version ^1 || ^2 || ^3
psr/http-server-handler Version ^1 || ^2
psr/http-server-middleware Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package openapi-tools/generator-psr-15-webhook-middleware contains the following files

Loading the files please wait ...