fix: match scribe route prefix to subdomain API routing#205
Merged
ManukMinasyan merged 1 commit intomainfrom Mar 31, 2026
Merged
fix: match scribe route prefix to subdomain API routing#205ManukMinasyan merged 1 commit intomainfrom
ManukMinasyan merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes Scribe route discovery when API routes are served from a dedicated API subdomain (no /api path prefix), preventing empty OpenAPI specs in production when API_DOMAIN is set.
Changes:
- Make Scribe’s
routes.match.prefixesconditional onapp.api_domain(v1/*vsapi/v1/*). - Add feature tests asserting the Scribe config prefix matches the active routing mode.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
config/scribe.php |
Dynamically selects Scribe’s route prefix matcher based on whether API subdomain routing is enabled. |
tests/Feature/Routing/SubdomainRoutingTest.php |
Adds tests verifying Scribe config prefix aligns with both path-based and subdomain-based API routing. |
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.
Summary
API_DOMAINis set (production), API routes are registered on a subdomain without theapi/prefix — paths becomev1/*instead ofapi/v1/*api/v1/*, so it found zero matching routes and generated an empty OpenAPI spec (paths: [])v1/*whenAPI_DOMAINis set,api/v1/*otherwiseRegression introduced by #200.
Test plan
SubdomainRoutingTestverifying Scribe config prefix matches in both modesscribe:generatewithAPI_DOMAINset discovers all 32 endpoints (was 0)scribe:generatewithoutAPI_DOMAINstill works correctlyphp artisan scribe:generatein production to regenerate the spec