Search by

poagen / client-runtime

mlavrinenko

Marshalling, transport and attribute runtime for clients generated by poagen.

Package info

github.com/mlavrinenko/poagen-runtime

pkg:composer/poagen/client-runtime

Statistics

Installs: 44

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

0.1.0 2026-11-02 21:07 UTC

This package is auto-updated.

Last update: 2026-11-02 21:13:15 UTC


README

Marshalling, transport and attribute runtime for clients generated by poagen.

⚠️ Pre-alpha. API is unstable.

About

poagen/client-runtime is the small, dependency-light package every client poagen generates depends on at runtime. It carries no code generation logic of its own — nothing here knows what an OpenAPI document is — only the machinery a generated client calls into:

  • Endpoint / ResponseType — a generated operation describes its request as an Endpoint and the shape it expects back as a ResponseType, and hands both to an injected TransportInterface.
  • Envelope — every operation returns one, carrying the HTTP status the wire sent, the body hydrated into the shape the document declared for that status, and the PSR-7 response both came from. A declared status is a return value, never a throw; a profile's Generated\ApiException is raised only for a status the document declared nothing for, or a declared body that failed to hydrate.
  • Marshaller / Hydrator — a shared pair driving every (de)serialisation via phpdoc types and a small set of runtime attributes (#[WireName], #[Discriminator], #[AdditionalProperties], …). Model classes generated against this runtime carry no generator boilerplate of their own.
  • Replaceable — every runtime collaborator a generated file names is an interface under src/Contract/, and generated type-hints point at those rather than at implementations. Supply your own hydrator, marshaller, XML writer, descriptor parser or error policy — or your own transport for all of it.

This package is a consumer of PSR-7 / PSR-17 / PSR-18 only — plug in Guzzle, Symfony HTTP Client, or anything else that implements them.

Installation

composer require poagen/client-runtime

Development

The package is developed in the poagen repository, where it lives as runtime/, and is fully self-contained: its composer.json, test suite, and every lint/static-analysis/formatting config are scoped to this tree alone, with the generator absent.

For a standalone checkout, git subtree split --prefix=runtime from the parent repository produces exactly this tree.

composer install
just check    # lint + test with the coverage floor enforced
just format   # auto-fix code style

License

MIT © Maxim Lavrinenko. See LICENSE.