You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This block of code in src/Utilities/Arr.php recursively omits all array keys that have null values
if (is_array($value)) {
$value = static::filter($value);
continue;
}
When building OAS documentation, you often want to keep keys with null values to show that, for example, a return value in an API response payload may contain null values but still include the keys for those values.
My team has forked this repo as well as the vyuldashev/laravel-open-api package employing this one in order to get around the issue and correctly generate our Open API docs. In the fork we have commented out this block of code.
The text was updated successfully, but these errors were encountered:
bryan-lee-git
changed the title
null values omitted from any filled array, even if the null is desired
Keys with null values omitted from any filled array, even if the key and null value is desired
Jun 15, 2023
This block of code in
src/Utilities/Arr.php
recursively omits all array keys that havenull
valuesWhen building OAS documentation, you often want to keep keys with
null
values to show that, for example, a return value in an API response payload may containnull
values but still include the keys for those values.My team has forked this repo as well as the vyuldashev/laravel-open-api package employing this one in order to get around the issue and correctly generate our Open API docs. In the fork we have commented out this block of code.
The text was updated successfully, but these errors were encountered: