Skip to content

Commit

Permalink
Merge branch 'release/3.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
lindyhopchris committed Nov 8, 2023
2 parents 6dfbbf4 + d2fde9c commit 6a0281d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
tools: composer:v2
coverage: none
ini-values: error_reporting=E_ALL
ini-values: error_reporting=E_ALL, zend.assertions=1

- name: Set Laravel Version
run: composer require "laravel/framework:^${{ matrix.laravel }}" --no-update
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
All notable changes to this project will be documented in this file. This project adheres to
[Semantic Versioning](http://semver.org/) and [this changelog format](http://keepachangelog.com/).

## Unreleased

## [3.2.0] - 2023-11-08

### Added

- Exceptions converted to JSON:API errors when debug mode is on now include all previous exceptions.

### Changed

- Registering routes no longer results in the server instance being thread-cached. This more accurately reflects
production environments, where routes would be cached so there would be no thread-cached JSON:API server when handling
a HTTP request. This means tests (and development environments where routes are not cached) more accurately behave in
the same way as production environments.
- Exceptions thrown during the encoding process are no longer caught and re-thrown as previous exceptions. This is due
to the number of questions we receive from developers who do not check previous exceptions, despite exception messages
stating that there is a previous exception to look at.

## [3.1.0] - 2023-07-20

### Added
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"require": {
"php": "^8.1",
"ext-json": "*",
"laravel-json-api/core": "^3.2",
"laravel-json-api/eloquent": "^3.0",
"laravel-json-api/encoder-neomerx": "^3.0",
"laravel-json-api/exceptions": "^2.0",
"laravel-json-api/core": "^3.3",
"laravel-json-api/eloquent": "^3.1",
"laravel-json-api/encoder-neomerx": "^3.1",
"laravel-json-api/exceptions": "^2.1",
"laravel-json-api/spec": "^2.0",
"laravel-json-api/validation": "^3.0",
"laravel/framework": "^10.0"
Expand Down
9 changes: 8 additions & 1 deletion src/Routing/Registrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

use Illuminate\Contracts\Routing\Registrar as RegistrarContract;
use LaravelJsonApi\Contracts\Server\Repository;
use LaravelJsonApi\Core\Server\ServerRepository;

class Registrar
{
Expand Down Expand Up @@ -55,9 +56,15 @@ public function __construct(RegistrarContract $router, Repository $servers)
*/
public function server(string $name): PendingServerRegistration
{
// TODO add the `once` method to the server repository interface
$server = match(true) {
$this->servers instanceof ServerRepository => $this->servers->once($name),
default => $this->servers->server($name),
};

return new PendingServerRegistration(
$this->router,
$this->servers->server($name)
$server,
);
}
}

0 comments on commit 6a0281d

Please sign in to comment.