Fix traceback when sending invalid parameters to the server

Fix #783
pull/794/head
Julien Duponchelle 8 years ago
parent 2c6063569a
commit a8b78a9b0a
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

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

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

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

Loading…
Cancel
Save