From ec12976b0fc0b46dc2b351ca9351a27410b07dbd Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 3 Jan 2022 14:28:10 +1100 Subject: [PATCH] 0.2.0-beta.5 --- CHANGELOG.md | 17 +++++++++++++---- docs/requests.md | 6 ++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 665ca3c..d79a367 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.2.0-beta.5] +### Added +- `Context::getBody()` method to retrieve the parsed JSON:API payload from the request +- `Context::sortRequested()` method to determine if a sort field has been requested + +### Fixed +- `Laravel\rules()`: Fix regression disallowing use of advanced validation rules like callbacks and `Rule` instances. (@SychO9) + ## [0.2.0-beta.4] ### Added - `Laravel\rules()`: Replace `{id}` placeholder in rules with the model's key. @@ -62,7 +70,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix pagination next link appearing when it shouldn't -[0.2.0-beta.4]: https://github.com/tobyzerner/json-api-models/compare/v0.2.0-beta.4...v0.2.0-beta.3 -[0.2.0-beta.3]: https://github.com/tobyzerner/json-api-models/compare/v0.2.0-beta.3...v0.2.0-beta.2 -[0.2.0-beta.2]: https://github.com/tobyzerner/json-api-models/compare/v0.2.0-beta.2...v0.2.0-beta.1 -[0.2.0-beta.1]: https://github.com/tobyzerner/json-api-models/compare/v0.2.0-beta.1...v0.1.0-beta.1 +[0.2.0-beta.5]: https://github.com/tobyzerner/json-api-server/compare/v0.2.0-beta.5...v0.2.0-beta.4 +[0.2.0-beta.4]: https://github.com/tobyzerner/json-api-server/compare/v0.2.0-beta.4...v0.2.0-beta.3 +[0.2.0-beta.3]: https://github.com/tobyzerner/json-api-server/compare/v0.2.0-beta.3...v0.2.0-beta.2 +[0.2.0-beta.2]: https://github.com/tobyzerner/json-api-server/compare/v0.2.0-beta.2...v0.2.0-beta.1 +[0.2.0-beta.1]: https://github.com/tobyzerner/json-api-server/compare/v0.2.0-beta.1...v0.1.0-beta.1 diff --git a/docs/requests.md b/docs/requests.md index 9cb42d4..0c9bae1 100644 --- a/docs/requests.md +++ b/docs/requests.md @@ -57,9 +57,15 @@ This object contains a number of useful methods: * `getPath(): string` Get the request path relative to the API's base path. +* `getBody(): ?array` + Get the parsed JSON:API payload. + * `fieldRequested(string $type, string $field, bool $default = true): bool` Determine whether a field has been requested in a [sparse fieldset](https://jsonapi.org/format/1.1/#fetching-sparse-fieldsets). +* `sortRequested(string $field): bool` + Determine whether a sort field has been requested. + * `filter(string $name): ?string` Get the value of a filter.