expressCart/lib/schemas/editProduct.json

54 lines
1.3 KiB
JSON
Raw Normal View History

{
2019-11-16 09:01:57 +10:00
"$id": "editProduct",
"type": "object",
"properties": {
2019-06-20 13:14:04 +10:00
"productId": {
"type": "string"
},
"productPermalink": {
"type": "string",
"isNotEmpty": true,
"minLength": 2
},
"productTitle": {
"type": "string",
"isNotEmpty": true,
"minLength": 5
},
"productPrice": {
"type": "string",
2019-11-16 12:22:54 +10:00
"format": "amount"
},
"productDescription": {
"type": "string",
"isNotEmpty": true,
"minLength": 25
},
"productPublished": {
"type": "boolean"
},
"productTags": {
"type": "string"
},
"productOptions": {
"type": ["object", "string", "null"]
},
"productComment": {
"type": "boolean"
},
"productStock": {
"type": ["number", "null"]
}
},
"errorMessage": {
"isNotEmpty": "This is my custom error message",
"properties": {
"productPrice": "Should be a full 2 decimal value. Eg: 10.99",
"productPublished": "Should be either true or false",
"productComment": "Should be either true or false"
}
},
"required": [
2019-06-20 13:14:04 +10:00
"productId"
]
}