Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New validation implementation #235

Merged
merged 24 commits into from Oct 11, 2018
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e257691
[Feature-WIP] Add tests for existing spec validation
lindyhopchris Jun 30, 2018
9374179
[Feature-WIP] Add some initial ideas for spec validators
lindyhopchris Sep 7, 2018
b55d2e8
Merge branch 'develop' into feature/validation
lindyhopchris Sep 7, 2018
da86b4a
Update tests
lindyhopchris Sep 7, 2018
2119bbd
Merge branch 'develop' into feature/validation
lindyhopchris Sep 21, 2018
705b774
Add an idea for resource object data handling
lindyhopchris Sep 22, 2018
de7541f
Get the resource validator working
lindyhopchris Oct 1, 2018
9c3a0af
Get the relationship validator working
lindyhopchris Oct 1, 2018
cf9c1bf
Wire up new spec validation
lindyhopchris Oct 2, 2018
cac8f5e
Remove unnecessary factory
lindyhopchris Oct 2, 2018
0a0ce49
Wire in the new and old validators
lindyhopchris Oct 2, 2018
e65a8d1
Add error translation
lindyhopchris Oct 3, 2018
1c13ebe
Add in client generated id validation
lindyhopchris Oct 3, 2018
2988870
Add some minor changes and fixes
lindyhopchris Oct 3, 2018
12fa2ac
Add query rule objects and remove use of query checker
lindyhopchris Oct 4, 2018
88f5ac9
Update validators stub
lindyhopchris Oct 4, 2018
3694418
Tidy up and some minor improvements
lindyhopchris Oct 4, 2018
16cc642
Improve allowed query parameter error messages
lindyhopchris Oct 4, 2018
ef31182
Add some docs, tidy up and minor changes
lindyhopchris Oct 4, 2018
049e4da
Fix PHP constraint
lindyhopchris Oct 5, 2018
2353631
Add helper methods to the new resource object
lindyhopchris Oct 9, 2018
20c1d70
Update test helpers and accept arrayable data for test requests
lindyhopchris Oct 9, 2018
acd8ae0
Update documentation
lindyhopchris Oct 11, 2018
a717615
Add some PHP 7 type hints and doc bloc updates
lindyhopchris Oct 11, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
@@ -1,7 +1,6 @@
language: php

php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,37 @@
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

### Added
- New validation implementation that uses Laravel validators throughout. See the
[validation documentation](./docs/basics/validators.md) for details.
- Errors for the new validation implementation now have their `title`, `detail` and `code` members
translated via Laravel's translator. This means consuming applications can change the messages
by overriding the default translations provided by this package.

### Changed
- Minimum PHP version is now `7.0`.
- Minimum Laravel version is now `5.5`.
- The validated request object is now abstract, with a concrete implementation for each type
of request.

### Removed
- The `Auth\HandlesAuthorizers` trait was removed and its logic moved into the `Authorize` middleware.

### Deprecated
- The previous validation solution is deprecated in favour of the new solution and will be removed at `2.0`.
- The error factory implementation is deprecated in favour of using Laravel translation and will be removed at `2.0`.
- The `Document\Error` and `Contracts\Document\MutableErrorInterface` are deprecated and will be removed
at `2.0`. You should use the error interface/class from the `neomerx/jsonapi` package instead.
- The following utility classes/traits/interfaces are deprecated and will be removed at `2.0`:
- `Utils/ErrorCreatorTrait`
- `Utils/ErrorsAwareTrait` and `Contracts\Utils\ErrorsAwareInterface`
- `Utils/Pointers`
- `Utils/Replacer` and `Contracts\Utils\ReplacerInterface`
- The `Contracts\Factories\FactoryInterface` is deprecated and will be removed at `1.0`.
You should type-hint `Factories\Factory` directly instead.

## [1.0.0-beta.3] - 2018-09-21

### Added
Expand Down
20 changes: 9 additions & 11 deletions README.md
Expand Up @@ -24,17 +24,15 @@ A demo application is available at [here](https://github.com/cloudcreativity/dem

## Laravel Versions

| Laravel | This Package |
| --- | --- |
| 5.7.* | `1.0.0-beta.3` |
| 5.6.* | `1.0.0-beta.3` |
| 5.5.* | `1.0.0-beta.3` |
| 5.4.* | `1.0.0-beta.3` |

Make sure you consult the [Upgrade Guide](http://laravel-json-api.readthedocs.io/en/latest/upgrade/) when upgrading.

> We plan to release `1.0.0` with a minimum PHP version of `7.1`. This means we will drop support for Laravel 5.4
at some point during the `beta` release cycle.
| Laravel | This Package | EOL? |
| --- | --- | --- |
| 5.7.* | `1.0.0-beta.3` | - |
| 5.6.* | `1.0.0-beta.3` | - |
| 5.5.* | `1.0.0-beta.3` | - |
| 5.4.* | `1.0.0-beta.3` | EOL |

Make sure you consult the [Upgrade Guide](http://laravel-json-api.readthedocs.io/en/latest/upgrade/)
when upgrading.

## Lumen

Expand Down
20 changes: 10 additions & 10 deletions composer.json
Expand Up @@ -22,16 +22,16 @@
}
],
"require": {
"php": "^5.6|^7.0",
"php": ">=7.0",
lindyhopchris marked this conversation as resolved.
Show resolved Hide resolved
"ext-json": "*",
"cloudcreativity/utils-object": "^1.0",
"illuminate/console": "5.4.*|5.5.*|5.6.*|5.7.*",
"illuminate/contracts": "5.4.*|5.5.*|5.6.*|5.7.*",
"illuminate/database": "5.4.*|5.5.*|5.6.*|5.7.*",
"illuminate/filesystem": "5.4.*|5.5.*|5.6.*|5.7.*",
"illuminate/http": "5.4.*|5.5.*|5.6.*|5.7.*",
"illuminate/pagination": "5.4.*|5.5.*|5.6.*|5.7.*",
"illuminate/support": "5.4.*|5.5.*|5.6.*|5.7.*",
"illuminate/console": "5.5.*|5.6.*|5.7.*",
"illuminate/contracts": "5.5.*|5.6.*|5.7.*",
"illuminate/database": "5.5.*|5.6.*|5.7.*",
"illuminate/filesystem": "5.5.*|5.6.*|5.7.*",
"illuminate/http": "5.5.*|5.6.*|5.7.*",
"illuminate/pagination": "5.5.*|5.6.*|5.7.*",
"illuminate/support": "5.5.*|5.6.*|5.7.*",
"neomerx/json-api": "^1.0.3",
"symfony/psr-http-message-bridge": "^1.0",
"zendframework/zend-diactoros": "^1.3"
Expand All @@ -41,8 +41,8 @@
"cloudcreativity/json-api-testing": "^0.4",
"guzzlehttp/guzzle": "^6.3",
"mockery/mockery": "^1.1",
"orchestra/testbench": "3.4.*|3.5.*|3.6.*|3.7.*",
"phpunit/phpunit": "^5.7|^6.0|^7.0"
"orchestra/testbench": "3.5.*|3.6.*|3.7.*",
"phpunit/phpunit": "^6.0|^7.0"
},
"suggest": {
"cloudcreativity/json-api-testing": "Required to use the test helpers."
Expand Down