Comments (6)
Which version of the library do you have installed?
from json-api.
Also, how are you inserting the top level code
, message
, and success
keys?
from json-api.
Which version of the library do you have installed?
Latest
composer show -v | grep timacdonald/json-api
timacdonald/json-api dev-main 93dfac0 A Lightweight JSON:API Resource for Laravel
from json-api.
Also, how are you inserting the top level
code
,message
, andsuccess
keys?
To have consistent responses I use these helper:
public function sendResponse(string|array|JsonResource $result = '', string $message = 'ok'): JsonResponse
{
$response = [
'success' => true,
'data' => $result,
'message' => $message,
'code' => 200,
];
return response()->json($response, 200);
}
public function sendError(string $error, array $errorMessages = [], int $code = 404): JsonResponse
{
$response = [
'success' => false,
'message' => $error,
'code' => $code,
];
if (! count($errorMessages)) {
$response['data'] = $errorMessages;
}
return response()->json($response, $code);
}
And that could be the issue ?
from json-api.
I would really recommend using one of the tagged betas: https://github.com/timacdonald/json-api/releases
dev-main is not guaranteed to be in a good state.
Can you create a reproduction repository for this? I'm unable to replicate the issue.
from json-api.
I just followed the intsllation and did:
composer require timacdonald/json-api
from json-api.
Related Issues (20)
- Would you consider adding links to relationships in milestone for v1.x HOT 2
- To Many relationship wrong wrapped? HOT 7
- [Question] How to include tree relationships? HOT 7
- Getting empty results in browser
- Using with non Model resources. HOT 1
- Laravel 10 support HOT 1
- Laravel 10 support HOT 2
- Default include relationship HOT 1
- JsonApiServerImplementation 'final'`, doesn't allow custom implementations HOT 2
- Relationship attributes are not displayed in the response HOT 2
- Do this for James
- Lumen support? HOT 1
- Relationships not shown while having data HOT 5
- How to get from JsonResource to JsonApiResource HOT 1
- Type is plural HOT 1
- Is the response following v1.0 or ? HOT 1
- laravel 10
- i now want some vegemite HOT 2
- Clarification for how to use with many to many HOT 2
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 json-api.