Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' into callback-input
Browse files Browse the repository at this point in the history
  • Loading branch information
tmbo committed Aug 31, 2018
2 parents d0b796d + 9473e1a commit f62c071
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rasa_core/nlg/callback.py
Expand Up @@ -25,18 +25,18 @@ def nlg_response_format_spec():
"type": "string"
},
"buttons": {
"type": "array",
"type": ["array", "null"],
"items": {"type": "object"}
},
"elements": {
"type": "array",
"type": ["array", "null"],
"items": {"type": "object"}
},
"attachment": {
"type": "object"
"type": ["object", "null"]
},
"image": {
"type": "string"
"type": ["string", "null"]
}
},
}
Expand Down
5 changes: 5 additions & 0 deletions tests/test_nlg.py
Expand Up @@ -79,3 +79,8 @@ def test_nlg_schema_validation():
def test_nlg_schema_validation_empty_buttons():
content = {"text": "Hey there!", "buttons": []}
assert CallbackNaturalLanguageGenerator.validate_response(content)


def test_nlg_schema_validation_empty_image():
content = {"text": "Hey there!", "image": None}
assert CallbackNaturalLanguageGenerator.validate_response(content)

0 comments on commit f62c071

Please sign in to comment.