Releases
What’s Changed
- Fixed Octane issue that caused documentation generation failure on consequent requests
What’s Changed
- Fix Laravel Data class definition issues
What’s Changed
- Fixed dot named parameters handling of Laravel Data objects
What’s Changed
- Improve nested required parameters handling by @romalytvynenko in #1042
What’s Changed
- Reduce arrayable schema extension priority by @romalytvynenko in #1039
🚨 Breaking changes
While unlikely this is going to affect you, RulesToParameter class has been removed. It was the internal not documented class, so it wasn’t intended to be used on its own. Due to the low possibility of this affecting someone, I’m not tagging a new 0.14.x release.
What’s Changed
- Rules documentation API by @romalytvynenko in #1016
- Use IntegerRangeType for pagination schema fields by @hosni in #1018
- Fix recursive self out by @romalytvynenko in #1019
New Contributors
- @hosni made their first contribution in #1018
What’s Changed
- Added support of variables used in validation rules by @chaikivskyi in #1005
- Fixed
isInstanceOfcould’ve returnednullfor template type. - Fixed infinite recursion for cases when
@mixinof the class alias is used on the same class 😵💫
New Contributors
- @chaikivskyi made their first contribution in #1005
What’s Changed
- Expose more internal type inference related APIs by @romalytvynenko in #1006
What’s Changed
- Compatibility with Scramble 0.13.x
While this release has no breaking changes itself, the resulting OpenAPI document may be more accurate for your specific application, and hence may be considered as the one containing breaking changes. Due to this, I’ve decided to mark this release as 0.13.x. It means that you’ll need to explicitly update the version in composer.json if you rely on ^0.12.0 or earlier versions.
Full type inference
Starting from Laravel 11.x (and especially from 12.x), Laravel comes with great and accurate PHPDoc annotations. With Scramble supporting these types, you’ll enjoy focusing more on the app codebase rather than writing type annotations.
use App\Models\Appointment;
Route::get('/appointments', function (Request $request) {
$items = Appointment::query()
->where('status', $request->string('status'))
->get();
return $items;
});
In this case, Scramble can infer the type of $items: it is a collection of appointments, specifically: Illuminate\Database\Eloquent\Collection<int, App\Models\Appointment>!
This gives nice documentation just by analyzing the source, without any additional annotations.
Closure-based routes support
Previously, Scramble only supported controller-based routes. Now, the routes defined using closures also get their share of love and are documented automatically.
Closure-based routes support all the attributes (for manual parameters, headers, responses, etc.) that are supported by controller-based methods.
What’s Changed
- Add closure routes support by @romalytvynenko in #971
- Infer null coalescing operator by @jrdnrc in #980
- Added analysis of types coming from PHPDoc annotations in vendor by @romalytvynenko in #988
- Support more integer types by @Neol3108 in #996
- Add
Request@usermethod support for better post-installation experience by @romalytvynenko in #1001
New Contributors
- @Neol3108 made their first contribution in #996
What’s Changed
- Added config for flattening query object parameters
- Replace api path only if it appears at the beginning
- Improve
date_formatrule documentation - Added enum names extension property support
- Add support for wildcard array keys in validation rules
What’s Changed
- Add custom
paginationInformationmethod support
What’s Changed
- Updated templates inference for JSON API collections
What’s Changed
- Fixed paginator links in JSON API resource collection being not marked as optional when a resource didn’t have relationships
What’s Changed
- Fixed for JSON API identifiers for resource collections relationships
- Compatibility fixes with Scramble
0.12.31by @romalytvynenko in #72
What’s Changed
- Fixed paginated data collections documentation when the type is inferred
- Correct JSON API response content type (
application/vnd.api+json) by @romalytvynenko in #70