knuckleswtf / knuckleswtf/scribe
Error with variables in base URL
- Dominant language
- PHP
- Stars
- 2.3k
- Forks
- 357
- PR merge metrics
- No merged PRs in 30d
Description
### Scribe version
3.37.2
### Your question
Hi, I have an error when I run the generate command:

I think it's because I have a prefix on all my routes:
```php
Route::prefix('{' . CheckVersion::ROUTE_PARAM_VERSION . '}/{' . CheckCallingContext::ROUTE_PARAM_CALLING_CONTEXT . '}')
```
This is my `config/scribe.php`
```php
...
'routes' => [
[
/*
* Specify conditions to determine what routes will be a part of this group.
* A route must fulfill ALL conditions to be included.
*/
'match' => [
/*
* Match only routes whose paths match this pattern (use * as a wildcard to match any characters). Example: 'users/*'.
*/
'prefixes' => ['{version}/{callingContext}/*'],
/*
* Match only routes whose domains match this pattern (use * as a wildcard to match any characters). Example: 'api.*'.
*/
'domains' => ['*'],
/*
* [Dingo router only] Match only routes registered under this version. Wildcards are not supported.
*/
'versions' => ['v1'],
],
...
```
I only change `routes.match.prefixes` to detect my routes.
According to the open api specification, I would like to use variables in urls: https://swagger.io/docs/specification/api-host-and-base-path/
Thanks for your help
### Docs
- [x] I've checked [the docs](https://scribe.knuckles.wtf/laravel), the [troubleshooting guide](https://scribe.knuckles.wtf/laravel/troubleshooting), and [existing issues](https://github.com/knuckleswtf/scribe/issues?q=is%3Aissue+), but I didn't find a solution
Contributor guide
Research direction
Start with the generate command and the routes.match.prefixes configuration in config/scribe.php, reproducing the issue with the dynamic version and calling-context route prefix shown here. Compare the generated output with the OpenAPI URL-variable requirement; done means generation completes and represents those route variables correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100