Skip to content

Releases: CanDgrmc/doctreen-php

Release list

v0.1.1

Choose a tag to compare

@CanDgrmc CanDgrmc released this 01 Aug 17:37

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 by scripts/sync-ui.php
    rather than reimplemented, so the two cannot drift apart visually.
  • OpenAPI 3.1 export at /docs/openapi.json — $ref dedup, tags, callbacks and
    webhooks. Checked against the npm exporter's output by tests/ExporterParityTest.php.

Runtime

  • Request validation — a structured 422 before 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 409 is checked against the schema declared
    for 409 rather than against the success schema. Development-time only; warn or
    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
    through doctreen-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|client emits 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.