Hello!
Trying to validate this json:
{
"attachments": [
{
"mimetype": "image/jpeg",
"content": "R0lGODlhGQAZAPMHAAAAAFpaWv+gAN+MNdDWDfj/AH1t+P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAgALAAAAAAZABkAAASKEMlJq7046wvA3oDgfVwoklUnrMGJIia7jmS8zgFqFzdA5B+b4LAa+GgYIYA4MBKQpZagsGwOCE9JAGjxFb6FQGEgzopz267322Frw2dLq9P+BjxScfhyJ4C3Jy0texkdUgIGRjcsGgFYAAYGAE0maRmCj5OUlo1bWz8BZFwvgAKcLxOnqKusrRsRADs=",
"filename": "chili-pepper.jpg"
}
],
"inlines": [
{
"mimetype": "image/jpeg",
"filename": "chili-pepper-inline1.jpg"
}
],
"category": "wgnc:exclusive",
"body_html": "<HTML><body><img src=\"cid:chili-pepper-inline1.jpg\"></body></HTML>",
"text": "test_text",
"subject": "Autotest subject"
}
with this schema:
{
"description": "Email message",
"type": "object",
"properties": {
"subject": {
"type": "string",
"minLength": 1,
"pattern": "^[^\\r\\n\\t]+$"
},
"text": {
"type": "string",
"minLength": 1
},
"html": {
"type": "string",
"minLength": 1
},
"from": {
"type": "string",
"minLength": 1
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"required": [
"filename",
"mimetype",
"content"
],
"properties": {
"filename": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"mimetype": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"content": {
"type": "string",
"minLength": 1,
"maxLength": 25000000,
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
}
}
}
},
"inlines": {
"type": "array",
"items": {
"type": "object",
"required": [
"filename",
"mimetype",
"content"
],
"properties": {
"filename": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"mimetype": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"content": {
"type": "string",
"minLength": 1,
"maxLength": 25000000
}
}
}
}
},
"anyOf": [
{
"required": [
"subject",
"html"
]
},
{
"required": [
"subject",
"text"
]
}
]
}
result is:
./_build/default/bin/jesse --json /Users/a_dziaineka/Repos/jesse/test_json/email_message.json -- /Users/a_dziaineka/Repos/jesse/test_json/test.json
{"filename":"/Users/a_dziaineka/Repos/jesse/test_json/test.json","result":"ok"}
But online validator found error (link to the case):
Message:
Required properties are missing from object: content.
Schema path:
#/properties/inlines/items/required
Is it a bug?
Hello!
Trying to validate this json:
{ "attachments": [ { "mimetype": "image/jpeg", "content": "R0lGODlhGQAZAPMHAAAAAFpaWv+gAN+MNdDWDfj/AH1t+P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAgALAAAAAAZABkAAASKEMlJq7046wvA3oDgfVwoklUnrMGJIia7jmS8zgFqFzdA5B+b4LAa+GgYIYA4MBKQpZagsGwOCE9JAGjxFb6FQGEgzopz267322Frw2dLq9P+BjxScfhyJ4C3Jy0texkdUgIGRjcsGgFYAAYGAE0maRmCj5OUlo1bWz8BZFwvgAKcLxOnqKusrRsRADs=", "filename": "chili-pepper.jpg" } ], "inlines": [ { "mimetype": "image/jpeg", "filename": "chili-pepper-inline1.jpg" } ], "category": "wgnc:exclusive", "body_html": "<HTML><body><img src=\"cid:chili-pepper-inline1.jpg\"></body></HTML>", "text": "test_text", "subject": "Autotest subject" }with this schema:
{ "description": "Email message", "type": "object", "properties": { "subject": { "type": "string", "minLength": 1, "pattern": "^[^\\r\\n\\t]+$" }, "text": { "type": "string", "minLength": 1 }, "html": { "type": "string", "minLength": 1 }, "from": { "type": "string", "minLength": 1 }, "attachments": { "type": "array", "items": { "type": "object", "required": [ "filename", "mimetype", "content" ], "properties": { "filename": { "type": "string", "minLength": 1, "maxLength": 256 }, "mimetype": { "type": "string", "minLength": 1, "maxLength": 256 }, "content": { "type": "string", "minLength": 1, "maxLength": 25000000, "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" } } } }, "inlines": { "type": "array", "items": { "type": "object", "required": [ "filename", "mimetype", "content" ], "properties": { "filename": { "type": "string", "minLength": 1, "maxLength": 256 }, "mimetype": { "type": "string", "minLength": 1, "maxLength": 256 }, "content": { "type": "string", "minLength": 1, "maxLength": 25000000 } } } } }, "anyOf": [ { "required": [ "subject", "html" ] }, { "required": [ "subject", "text" ] } ] }result is:
./_build/default/bin/jesse --json /Users/a_dziaineka/Repos/jesse/test_json/email_message.json -- /Users/a_dziaineka/Repos/jesse/test_json/test.json {"filename":"/Users/a_dziaineka/Repos/jesse/test_json/test.json","result":"ok"}But online validator found error (link to the case):
Is it a bug?