laravel-json-api / neomerx-json-api Goto Github PK
View Code? Open in Web Editor NEWThis project forked from neomerx/json-api
Framework agnostic JSON API (jsonapi.org) implementation
License: Apache License 2.0
This project forked from neomerx/json-api
Framework agnostic JSON API (jsonapi.org) implementation
License: Apache License 2.0
I'm upgrading my application to version 6.0.0 of cloud-creativity/laravel-json-api
, which includes this package.
I'm getting an error in src/Schema/Error.php. It happens in the laravel exception handler when I'm handling an authentication error - i.e. not a json-api error.
This class has a property $links
, which is defined as:
neomerx-json-api/src/Schema/Error.php
Line 40 in c687b12
The constructor initialises it by calling setLink()
:
neomerx-json-api/src/Schema/Error.php
Lines 171 to 180 in c687b12
It is then accessed using getLinks():
neomerx-json-api/src/Schema/Error.php
Lines 150 to 153 in c687b12
The problem is that when the $link
parameter to setLink()
is null, then the call to unset()
doesn't actually initialise the property, and the following error is generated when you call getLink()
:
Uncaught Error: Typed property Neomerx\\JsonApi\\Schema\\Error::$links must not be accessed before initialization in /Users/gr4376/Projects/nquire/vendor/laravel-json-api/neomerx-json-api/src/Schema/Error.php:152
.
AFAICT, the fix is simply to initialise the property:
private ?iterable $links = null;
The original neomerx package was framework agnostic. After the fork, this rep also says it's "framework" agnostic in the info panel. However, the repo title suggests it is Laravel only. Which is correct? And if it's Laravel only, why was that change made?
The description for withMeta()
on the EncoderInterface
says:
Add meta information that will be encoded with data. If 'null' meta will not appear in a document.
However the encoder does include meta
as null
if you call Encoder::withMeta(null)
. The bug is in the EncoderPropertiesTrait
.
Hi,
When I try to run my installation I get this error:
Declaration of Neomerx\JsonApi\Factories\Factory::setLogger(Psr\Log\LoggerInterface $logger) must be compatible with Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger): void
I am using this library via: "cloudcreativity/laravel-json-api": "4.*"
Thanks in advance, Regards!
When using this package with PHP 8.1 I am getting the following error:
[Error] Typed property Neomerx\JsonApi\Schema\Error::$links must not be accessed before initialization in
/var/www/html/vendor/laravel-json-api/neomerx-json-api/src/Schema/Error.php on line 152
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.