Releases
What’s Changed
- Remove reliance on type’s
getOriginal
Tuple schemas no longer emit additionalItems. Homogeneous unions now serialize as OpenAPI 3.1 type arrays instead of anyOf.
What’s Changed
🚨 Breaking changes 🚨
- Remove unsupported
additionalItemsfrom array schemas by @romalytvynenko in #1264
additionalItems existed in older JSON Schema drafts. OpenAPI 3.1 uses JSON Schema 2020-12, where that keyword is gone — extra items after prefixItems are controlled by items instead.
Scramble was emitting additionalItems: false on fixed-length array / tuple schemas (prefixItems plus minItems / maxItems). Validators such as Redocly rejected the document: Property additionalItems is not expected here.
Tuple length is already pinned with minItems / maxItems, so the extra keyword was both invalid and redundant. It is omitted rather than replaced with items: false.
The generated spec will no longer contain additionalItems. ArrayType::setAdditionalItems() is also gone. This is very unlikely to affect you unless a client or linter depended on that keyword, or you called the setter yourself.
- Optimize homogeneous union schemas into type arrays by @romalytvynenko in #1269
Unions whose branches are only types (string|int, int|float|string, unconstrained array|string, …) now serialize as a type array instead of anyOf:
{ "type": ["string", "integer"] }
instead of
{ "anyOf": [{ "type": "string" }, { "type": "integer" }] }
anyOf is kept when a branch has extra keywords (enum, const, …). integer is dropped when number is present (JSON Schema: integer is a subset of number), so int|float becomes { "type": "number" }. Empty items: {} on unconstrained arrays is omitted so they can fold into the same form.
This is valid OpenAPI 3.1 and usually renders the same in the UI, but generated clients may change if they treated anyOf and type arrays differently.
Added
- Infer arithmetic, string concatenation, and
cloneinstead of documenting them asstringby @romalytvynenko in #1267
Unknown operands are treated as numeric (int|float) rather than unknown/string. + also documents array union ($a + [] → array). Impossible arithmetic (1 + []) is never. Concat of mixed values keeps enough of the template to guess download MIME from the extension.
Changes
- Stop treating plain comments above
returnas response descriptions — only explicit@description,@status, and@bodyapply by @yugarinn in #1254 - Serialize string-like
| nullunions as a nullable string (type: ["string", "null"]) instead ofanyOf
Fixes
- Handle unpacked and implicit array keys in schemas by @romalytvynenko in #1266
- Fix object type acceptance to respect class hierarchy by @romalytvynenko in #1265
- Preserve PHPDoc types while refining inferred model attributes by @romalytvynenko in #1263
- Fix type refining so declared types keep their shape while picking up inferred details (formats, generics, array shapes) by @romalytvynenko in #1268
- Fix JSON resource model guessing and analyze vendor resource bodies by @romalytvynenko in #1260
- Document
paginate()onmixedas a paginator - Bind native
selfreturn types to the receiver so chained setters keep their generic
New Contributors
- @yugarinn made their first contribution in #1254
What’s Changed
- Dev tools by @romalytvynenko in #1255
What’s Changed
- Fix schemas for wrapped nested Laravel Data collections
What’s Changed
- Preserve pagination metadata for resource collection JSON responses by @romalytvynenko in #1251
What’s Changed
- Fix pagination documentation for mixed Scout and Eloquent queries by @romalytvynenko in #1243
- Preserve inferred model type metadata with compatible PHPDoc properties by @romalytvynenko in #1244
- Infer Storage downloads as binary streamed responses by @romalytvynenko in #1245
- Add PHP’s Deprecated attribute support by @romalytvynenko in #1246
What’s Changed
- Fix Laravel Data casts with multiple date formats
New features
- Add eager-loaded relationship analysis for JSON resources by @romalytvynenko in #1188
- Add property types from PHPDoc support by @chrisvanlier2005 in #1057
- Infer nullable Eloquent relations from foreign key columns by @romalytvynenko in #1225
- Add custom casts support for model attributes by @romalytvynenko in #1227
Fixes
What’s Changed
- Document enum morph properties as constants
What’s Changed
- Fix QueryBuilder params missing on shared helper callers
What’s Changed
- Fix fatal/wrong schema for DataCollection|Optional properties
What’s Changed
- Fix query builder indexing when query builders are configured without reassignment, not in a single call chain
What’s Changed
- Resolve references types in self out type builder by @romalytvynenko in #1221
What’s Changed
- Add
IgnoreResponseattribute to exclude responses from docs by @romalytvynenko in #1210 - Add
#[Api]attribute for route-level API assignment by @romalytvynenko in #1211 - Fix file min/max/size/between rules emitting minLength/maxLength by @romalytvynenko in #1212
- Fix request body parameter order when merging nested rules by @romalytvynenko in #1213
What’s Changed
- Fix incorrect binding of route parameters
What’s Changed
- Fix
Lazy|recursiveproperties failing to be documented
What’s Changed
- Fix custom Query Builder parameter names in docs