feat(Builder): add withSpecification(), a contribution seam before resolution - #2218
Merged
DerManoMann merged 2 commits intoSep 27, 2026
Merged
Conversation
…solution Builder::withSpecification() registers callables that receive the assembled Specification between assembly and resolution; hooks accumulate and run in registration order. OperationIds derives an id from method and path for an operation with no reflector. Each Builder hook's docblock states when it runs and whether repeated calls accumulate or replace. The extension-points guide gains a contributions section with an executed snippet, the builder reference and modes table gain the hook, and the builder reference's closing example is removed.
The extension-points guide, the builder reference and the withSpecification() docblock describe contributions as attributes the assembler did not build, with or without a reflector, rather than as reflector-less metadata only. SpecificationContributionTest covers an operation and parameters contributed with their reflectors, against a new attribute-free PlainController fixture.
DerManoMann
added a commit
to DerManoMann/openapi-introspector
that referenced
this pull request
Sep 27, 2026
withSpecification() merged as zircote/swagger-php#2218, so the fork's branch and the path repository at ../swagger-php have nothing left to provide: packagist serves dev-master at the same commit. Dropping the repository is what lets a plain `composer install` work anywhere, CI included. dev-master rather than a caret because the seam is merged but unreleased; this becomes ^6.x when the minor carrying it tags.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Metadata that describes an API but has no reflector cannot reach the spec pipeline.
A translator turns one attribute into another and needs something to read it off; an
entity registry or a serializer's configuration carries no attribute anywhere. The
only way in today is an augmenter, which runs after resolution, so a
$refinsidewhat it adds stays unresolved.
Builder::withSpecification()hands the assembledSpecificationto a callablebetween assembly and resolution. What it adds is resolved, augmented and compiled
with the scanned sources. The pipeline reads a reflector, not a source file, so a
contribution that carries one gets the scanned treatment, docblocks and parameter
types included, and one without gets an operation id from method and path since
there is no declaring code to name.
With a second deferred hook on
Builder, the docblocks' silence on when each hookruns and whether repeated calls accumulate became ambiguous, so each one now says.
Changes
Builder::withSpecification(), withSpecificationContributionTestOperationIdsfor an operationwith no reflector
Builderhook when it runs and whether repeated calls accumulateor replace
executed snippet and its expected output
snippets