Skip to content

Commit 6a0281d

Browse files
committed
Merge branch 'release/3.2.0'
2 parents 6dfbbf4 + d2fde9c commit 6a0281d

File tree

4 files changed

+31
-6
lines changed

4 files changed

+31
-6
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
2929
tools: composer:v2
3030
coverage: none
31-
ini-values: error_reporting=E_ALL
31+
ini-values: error_reporting=E_ALL, zend.assertions=1
3232

3333
- name: Set Laravel Version
3434
run: composer require "laravel/framework:^${{ matrix.laravel }}" --no-update

CHANGELOG.md

+18
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@
33
All notable changes to this project will be documented in this file. This project adheres to
44
[Semantic Versioning](http://semver.org/) and [this changelog format](http://keepachangelog.com/).
55

6+
## Unreleased
7+
8+
## [3.2.0] - 2023-11-08
9+
10+
### Added
11+
12+
- Exceptions converted to JSON:API errors when debug mode is on now include all previous exceptions.
13+
14+
### Changed
15+
16+
- Registering routes no longer results in the server instance being thread-cached. This more accurately reflects
17+
production environments, where routes would be cached so there would be no thread-cached JSON:API server when handling
18+
a HTTP request. This means tests (and development environments where routes are not cached) more accurately behave in
19+
the same way as production environments.
20+
- Exceptions thrown during the encoding process are no longer caught and re-thrown as previous exceptions. This is due
21+
to the number of questions we receive from developers who do not check previous exceptions, despite exception messages
22+
stating that there is a previous exception to look at.
23+
624
## [3.1.0] - 2023-07-20
725

826
### Added

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
"require": {
2626
"php": "^8.1",
2727
"ext-json": "*",
28-
"laravel-json-api/core": "^3.2",
29-
"laravel-json-api/eloquent": "^3.0",
30-
"laravel-json-api/encoder-neomerx": "^3.0",
31-
"laravel-json-api/exceptions": "^2.0",
28+
"laravel-json-api/core": "^3.3",
29+
"laravel-json-api/eloquent": "^3.1",
30+
"laravel-json-api/encoder-neomerx": "^3.1",
31+
"laravel-json-api/exceptions": "^2.1",
3232
"laravel-json-api/spec": "^2.0",
3333
"laravel-json-api/validation": "^3.0",
3434
"laravel/framework": "^10.0"

src/Routing/Registrar.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
use Illuminate\Contracts\Routing\Registrar as RegistrarContract;
2323
use LaravelJsonApi\Contracts\Server\Repository;
24+
use LaravelJsonApi\Core\Server\ServerRepository;
2425

2526
class Registrar
2627
{
@@ -55,9 +56,15 @@ public function __construct(RegistrarContract $router, Repository $servers)
5556
*/
5657
public function server(string $name): PendingServerRegistration
5758
{
59+
// TODO add the `once` method to the server repository interface
60+
$server = match(true) {
61+
$this->servers instanceof ServerRepository => $this->servers->once($name),
62+
default => $this->servers->server($name),
63+
};
64+
5865
return new PendingServerRegistration(
5966
$this->router,
60-
$this->servers->server($name)
67+
$server,
6168
);
6269
}
6370
}

0 commit comments

Comments
 (0)