mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
1 parent
cbe593f4a4
commit
d9f1a7c7d3
4 files changed
+47
-1
No files matched your search
@@ -87,6 +87,13 @@ class Response(aiohttp.web.Response):
|
||||
self.content_type = "application/json"
|
||||
if hasattr(answer, '__json__'):
|
||||
answer = answer.__json__()
|
||||
elif isinstance(answer, list):
|
||||
newanswer = []
|
||||
for elem in answer:
|
||||
if hasattr(elem, '__json__'):
|
||||
elem = elem.__json__()
|
||||
newanswer.append(elem)
|
||||
answer = newanswer
|
||||
if self._output_schema is not None:
|
||||
try:
|
||||
jsonschema.validate(answer, self._output_schema)
|
||||
|
||||
Reference in new issue
Block a user