perfect-payload 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ input:
|
|
|
47
47
|
}
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
**Note:** If inValidPayloadResponse is passed, then it will be returned along with errors property(avoid
|
|
50
|
+
**Note:** If inValidPayloadResponse is passed, then it will be returned along with errors property(avoid error attribute in your inValidPayloadResponse object)
|
|
51
51
|
|
|
52
52
|
## 2. Available Validation Attributes
|
|
53
53
|
|
|
@@ -57,7 +57,7 @@ These attributes define the rules that can be applied to each field in the data
|
|
|
57
57
|
- **allowNull**: Allows `null` values.
|
|
58
58
|
- **allowEmptyObject**: Allows empty objects `{}`.
|
|
59
59
|
- **allowEmptyArray**: Allows empty arrays `[]`.
|
|
60
|
-
- **elementConstraints**: Defines the constraints of elements in an array (refer to [Available
|
|
60
|
+
- **elementConstraints**: Defines the constraints of elements in an array (refer to [Available ](#available-types)[Attributes](#available-validation-attributes) section).
|
|
61
61
|
- **regex**: Applies custom regular expression validation.
|
|
62
62
|
- **type**: Specifies the type of the field (refer to [Available Types](#available-types) section).
|
|
63
63
|
- **minLength**: Minimum length for string values.
|
|
@@ -165,7 +165,7 @@ sample-1
|
|
|
165
165
|
sample-2
|
|
166
166
|
|
|
167
167
|
```javascript
|
|
168
|
-
|
|
168
|
+
{
|
|
169
169
|
id: {
|
|
170
170
|
mandatory: true,
|
|
171
171
|
allowNull: true,
|
|
@@ -216,14 +216,14 @@ sample-2
|
|
|
216
216
|
range: "0-100",
|
|
217
217
|
},
|
|
218
218
|
allMarks: {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
219
|
+
type: "array",
|
|
220
|
+
allowEmptyArray: false,
|
|
221
|
+
elementConstraints: {
|
|
222
|
+
type: "number",
|
|
223
|
+
allowNull: false,
|
|
224
|
+
range: "0-100",
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
227
|
totalScore: {
|
|
228
228
|
type: "number",
|
|
229
229
|
dependency: {
|