Skip to content

Commit fb1b46f

Browse files
committed
Add readme
1 parent 43501ff commit fb1b46f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Description
2+
3+
Extension for [neomerx/json-api](https://github.com/neomerx/json-api) that adds HTML Request Body content validation.
4+
5+
## Why?
6+
7+
PHP provides `json_decode` to decode a provided JSON string. However, the JSON API spec describes how the request
8+
JSON should be *semantically* correct. E.g. when a client is providing a resource object for a create request, the
9+
`attributes` member must be an object.
10+
11+
This package provides framework agnostic validation of the received request body content - so that it can be handled
12+
knowing that not only has `json_decode` successfully run, but that the structure of the decoded JSON is as expected.
13+
Provided decoders also returns decoded content as `StandardObject` instances, an object that provides a number of
14+
helper methods for handling the decoded content e.g. within a controller.
15+
16+
## Status
17+
18+
This repository is under active development and is currently in a pre-release state.
19+
20+
## License
21+
22+
Apache License (Version 2.0). Please see [License File](LICENSE) for more information.

0 commit comments

Comments
 (0)