1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-23 23:38:21 +00:00

Fix traceback when sending invalid parameters to the server

Fix #783
This commit is contained in:
Julien Duponchelle 2016-11-14 13:59:22 +01:00
parent 2c6063569a
commit a8b78a9b0a
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
3 changed files with 5 additions and 2 deletions

View File

@ -23,7 +23,8 @@ from gns3server.controller import Controller
from gns3server.schemas.node import (
NODE_OBJECT_SCHEMA,
NODE_UPDATE_SCHEMA
NODE_UPDATE_SCHEMA,
NODE_CREATE_SCHEMA
)
@ -42,7 +43,7 @@ class NodeHandler:
400: "Invalid request"
},
description="Create a new node instance",
input=NODE_OBJECT_SCHEMA,
input=NODE_CREATE_SCHEMA,
output=NODE_OBJECT_SCHEMA)
def create(request, response):

View File

@ -233,5 +233,6 @@ NODE_OBJECT_SCHEMA = {
"required": ["name", "node_type", "compute_id"]
}
NODE_CREATE_SCHEMA = NODE_OBJECT_SCHEMA
NODE_UPDATE_SCHEMA = NODE_OBJECT_SCHEMA
del NODE_UPDATE_SCHEMA["required"]

View File

@ -52,6 +52,7 @@ PROJECT_CREATE_SCHEMA = {
}
},
"additionalProperties": False,
"required": ["name"]
}
PROJECT_UPDATE_SCHEMA = {