oai/openapi-specification
The OpenAPI Specification is the official, language-agnostic standard for describing RESTful APIs. It lets humans and machines discover and understand a service's capabilities without source code, docs, or traffic inspection, making it foundational for API tooling in PHP and Laravel projects.
Identity and scope. The first finding a TPM must surface is a naming mismatch: oai/openapi-specification is not a Laravel or PHP package. It is the upstream OpenAPI Specification repository — the normative Markdown documents, JSON Schema dialect files, and examples that define OpenAPI 3.0.x / 3.1.x / 3.2. There is no composer.json, no service provider, no runtime API, no vendor/ autoload surface. It is a standards artifact, not a library. All value is realized indirectly, through the PHP tools that implement the spec (swagger-php, Scribe, cebe/php-openapi, league/openapi-psr7-validator, Spectral, oasdiff, openapi-generator).
Architecture fit. Strong, but at the contract layer rather than the application layer. If the Laravel estate exposes or consumes HTTP APIs — and virtually all do — the spec is the canonical interface definition between Laravel backends, mobile clients, third-party integrators, and gateway/APIM configuration. It fits as a design-time and CI-time dependency: the source of truth for route contracts, request/response schemas, auth schemes, and error envelopes. It does not belong in composer require in the conventional sense; at most an org vendors the JSON Schema files or pins a spec version tag for offline validation.
Integration feasibility. High, with caveats. The PHP ecosystem has mature OAS consumers, but they lag the spec. OpenAPI 3.0.3 is universally supported and the safe default. 3.1.x (JSON Schema 2020-12 alignment, webhooks, nullable/type-array changes) has uneven PHP validator support and will surface edge cases. 3.2 is effectively bleeding edge and should be treated as out of scope for a first adoption. The real integration work is governance and toolchain selection, not code.
Technical risk.
Key questions for the team.
oai/openapi-specification a real Composer dependency in our tree, or a mislabeled reference? If the former, what is pulling it in?Stack fit. Language-agnostic spec, PHP-native tooling. Typical Laravel shape: Laravel 10/11/12 on PHP 8.1+, Pest/PHPUnit for tests, GitHub Actions or GitLab CI. The spec slots into four seams — generation, validation, contract testing, and client/SDK generation — none of which require the upstream repo at runtime.
Reference toolchain.
| Concern | Candidate |
|---|---|
| Spec generation (code-first) | knuckleswtf/scribe, zircote/swagger-php |
| Spec parsing / validation | cebe/php-openapi, league/openapi-psr7-validator |
| Linting / style rules | Spectral with a custom ruleset |
| Breaking-change detection | oasdiff in CI |
| Client / SDK generation | openapi-generator, orval (TS clients) |
| Docs rendering | Redoc / Scalar / Swagger UI |
Migration path.
oasdiff breaking-change checks to CI. This is the step that converts the spec from documentation into a control.Compatibility. Pin the spec version explicitly in-repo (openapi: 3.0.3) and record it in an ADR. Vendor the JSON Schema dialect files if offline/air-gapped validation is required. Verify that every chosen tool declares support for the pinned version before standardizing; a single unsupported tool in the chain is enough to force a downgrade.
Sequencing. Governance decision first (version + owner), then a single-service pilot, then CI enforcement, then multi-service rollout, then codegen. Resist starting with codegen — generated clients amplify an unstable contract and will burn credibility on the first breaking change.
Maintenance. Spec drift is the dominant long-term cost, not tool upgrades. The spec decays the moment it stops being reviewed. Mitigations: treat the spec as code (PR review, CODEOWNERS), enforce CI lint + breaking-change gates, and generate rather than hand-write wherever annotations can carry the load. Budget roughly 15–20% of one engineer's time for the first two quarters to establish and defend the process.
Support. No vendor, no SLA. Support comes from the OpenAPI Initiative community and the maintainers of the consuming PHP tools. Apache-2.0 is commercially clean — no copyleft exposure, no attribution burden beyond notices. Internal ownership is mandatory; without a named owner this becomes orphaned documentation within a quarter.
Scaling. Two pressure points emerge past roughly a dozen services. First, $ref resolution and bundling across service boundaries — shared component schemas need a deliberate strategy (central components repo, or a bundler step producing a self-contained artifact). Second, spec proliferation — many small specs versus one monolith; the registry/versioning model should be decided before service count doubles, not after.
Failure modes to plan for.
oasdiff if it is wired in.Ramp-up. A mid-level Laravel engineer becomes productive with the spec-and-tooling workflow in roughly one to two sprints; full fluency with $ref composition, discriminators, and JSON Schema semantics takes considerably longer. TPM actions: fund a short internal enablement session, designate one spec champion per squad, and set an explicit version policy so teams are not making independent compatibility judgments.
TPM recommendation. Treat this repository as a standards reference and version anchor, not a dependency. Adopt OpenAPI 3.0.3 as the baseline, invest in CI enforcement before codegen, and measure success by the percentage of endpoints covered by a linted, contract-tested spec — not by adoption of the repo itself. The low opportunity score is expected and not a concern; the return here is reduced integration cost and fewer cross-team breakages, which will not appear on a package scorecard.
How can I help you explore Laravel packages today?