You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,16 @@
8
8
# php-json-schema-model-generator
9
9
Creates (immutable) PHP model classes from JSON-Schema files.
10
10
11
+
## Table of Contents ##
12
+
13
+
*[Motivation](#Motivation)
14
+
*[Requirements](#Requirements)
15
+
*[Installation](#Installation)
16
+
*[Examples](#Examples)
17
+
*[Configuring using the GeneratorConfiguration](#Configuring using the GeneratorConfiguration)
18
+
*[How the heck does this work?](#How the heck does this work?)
19
+
*[Tests](#Tests)
20
+
11
21
## Motivation ##
12
22
13
23
Simple example from a PHP application: you define and document an API with swagger annotations and JSON-Schema models. Now you want to use models in your controller actions instead of manually accessing the request data (eg. array stuff). Additionally your schema already defines the validation rules for the models. Why duplicate this rules into your manually written code? Instead you can set up a middleware which instantiates models generated with this library and feed the model with the request data. Now you have a validated model which you can use in your controller action. With full auto completion when working with nested objects. Yay!
0 commit comments