Releases: CanDgrmc/doctreen-php
Releases · CanDgrmc/doctreen-php
Release list
v0.1.1
The first usable release. 0.1.0 was tagged from an early commit and reached Packagist
carrying only the schema builder, route registry and service provider — none of what
follows was in it. It installs without erroring and then does nothing, which is why it has
been withdrawn.
Core
- Schema builder (
Doctreen\Schema\S) — a fluent builder producing the same SchemaNode
shape as the npm package, so one route declaration reads the same in both languages. ->doc()route macro — attaches the declaration to an ordinary Laravel route. No
router to replace, no annotations on every DTO field.- Route registry plus a config file whose keys mirror the npm package's config object,
so the configuration docs transfer unchanged.
Docs and export
- Interactive docs UI at
/docs— the same zero-dependency UI the npm package serves.
Its stylesheet and browser script are synced from that package byscripts/sync-ui.php
rather than reimplemented, so the two cannot drift apart visually. - OpenAPI 3.1 export at
/docs/openapi.json—$refdedup, tags, callbacks and
webhooks. Checked against the npm exporter's output bytests/ExporterParityTest.php.
Runtime
- Request validation — a structured
422before the handler runs, with query and
path-parameter coercion, optional write-back of the coerced values, and config-level
defaultErrors. - Response validation — status-aware, so a
409is checked against the schema declared
for409rather than against the success schema. Development-time only;warnor
throw. - Schema drift detection — samples real traffic and compares it against what each route
declared. PSR-16 cache-backed store,/docs/drift.json, guarded reset.
Tooling
- Integration flows — the same flow documents the docs UI runs, also runnable headless
throughdoctreen-flow. - Mock server —
doctreen mock --from <url|file>synthesises a spec-driven fake API
with CRUD short-circuits, latency and error injection, and optional Faker values. - PHP codegen —
doctreen codegen types|clientemits readonly DTOs and a
zero-dependency typed client from an OpenAPI document. - CLI —
mock,codegen,lint openapi,emit-openapi,drift report|reset.
Notes
- Requires PHP 8.2+. Zero runtime dependencies; the Laravel service provider is
auto-discovered and simply never loads outside Laravel. - Laravel only for now — Symfony and PSR-15 adapters are next.
- Tested on PHP 8.2, 8.3 and 8.4.