Comments (1)
Hey! Glad you're finding the package useful.
This is intentional. Here's why...
In JSON, a PHP array hash is an object. Therefore, an empty array needs to be serialised to null
in JSON. Because otherwise, clients would have to handle in Javascript the value being either an object or an array. It makes more sense for the client to expect an object or null
.
For an array list, in JSON/Javascript that's an array. Therefore an empty PHP array list can be serialised to an empty array.
Hope that makes sense!
from laravel.
Related Issues (20)
- Unable to encode compound document. See previous exception for cause of failure. HOT 7
- eager loading problem HOT 9
- Feature Requests: Inject Scopes middleware option HOT 5
- Best location to add cache for API get requests HOT 2
- Customize top-level meta when fetching related resource HOT 1
- Problem with countables relationships HOT 15
- [question] Validation on filter values HOT 4
- route model binding (Variable name cannot be longer than 32 characters in route pattern) HOT 9
- How to create resource belongsTo resource in one request? HOT 3
- Controllers cannot be placed in a custom namespace HOT 5
- Rules in a a ResourceRequest are not checked against the Schema's defined fields; no exception thrown for an incorrect Request HOT 2
- [Feature Request] Nesting Filters HOT 1
- Included morph to many data is `null` HOT 5
- Updating a model's relationships where the policy denies updating the relationship gives 200 OK, but doesn't update the relationship HOT 5
- Impossible to change route model binding? HOT 5
- Proper docs for v4.0 and Laravel 11.x HOT 1
- Exception Handling with Laravel 11.x HOT 8
- Filtering inlcuded resources HOT 1
- Error when handling validation failures HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel.