From a7fb8430b778d3c563f7fb4d90bd34cbf5de7fc0 Mon Sep 17 00:00:00 2001 From: Saeid Rezaei Baghbidi Date: Wed, 10 Jul 2019 21:02:03 -0700 Subject: [PATCH] Requests not failing if with additional properties --- src/schemas/agent.js | 20 ++++++++++---------- src/schemas/catalog.js | 8 ++++---- src/schemas/connector.js | 6 +++--- src/schemas/flow.js | 4 ++-- src/schemas/iofog.js | 20 ++++++++++---------- src/schemas/microservice.js | 14 +++++++------- src/schemas/registry.js | 6 +++--- src/schemas/user.js | 18 +++++++++--------- 8 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/schemas/agent.js b/src/schemas/agent.js index 70b34a865..e172c0205 100644 --- a/src/schemas/agent.js +++ b/src/schemas/agent.js @@ -19,7 +19,7 @@ const agentProvision = { 'key': { 'type': 'string' }, }, 'required': ['type', 'key'], - 'additionalProperties': false, + 'additionalProperties': true, } const agentDeprovision = { @@ -32,7 +32,7 @@ const agentDeprovision = { }, }, 'required': ['microserviceUuids'], - 'additionalProperties': false, + 'additionalProperties': true, } const updateAgentConfig = { @@ -56,7 +56,7 @@ const updateAgentConfig = { 'longitude': { 'type': 'number', 'minimum': -180, 'maximum': 180 }, 'gpsMode': { 'type': 'string' }, }, - 'additionalProperties': false, + 'additionalProperties': true, } const updateAgentStatus = { @@ -93,7 +93,7 @@ const updateAgentStatus = { 'isReadyToUpgrade': { 'type': 'boolean' }, 'isReadyToRollback': { 'type': 'boolean' }, }, - 'additionalProperties': false, + 'additionalProperties': true, } @@ -107,7 +107,7 @@ const updateAgentStrace = { 'required': [], }, }, - 'additionalProperties': false, + 'additionalProperties': true, } const straceData = { @@ -118,7 +118,7 @@ const straceData = { 'buffer': { 'type': 'string' }, }, 'required': ['microserviceUuid', 'buffer'], - 'additionalProperties': false, + 'additionalProperties': true, } const microserviceStatus = { @@ -134,7 +134,7 @@ const microserviceStatus = { 'memoryUsage': { 'type': 'number' }, }, 'required': ['id'], - 'additionalProperties': false, + 'additionalProperties': true, } const updateHardwareInfo = { @@ -144,7 +144,7 @@ const updateHardwareInfo = { 'info': { 'type': 'string' }, }, 'required': ['info'], - 'additionalProperties': false, + 'additionalProperties': true, } const updateUsbInfo = { @@ -154,7 +154,7 @@ const updateUsbInfo = { 'info': { 'type': 'string' }, }, 'required': ['info'], - 'additionalProperties': false, + 'additionalProperties': true, } const trackingArray = { @@ -174,7 +174,7 @@ const trackingMessage = { 'data': { '$ref': '/trackingData' }, }, 'required': ['uuid', 'sourceType', 'timestamp', 'type', 'data'], - 'additionalProperties': false, + 'additionalProperties': true, } const trackingData = { diff --git a/src/schemas/catalog.js b/src/schemas/catalog.js index 831730edb..e3f86942d 100644 --- a/src/schemas/catalog.js +++ b/src/schemas/catalog.js @@ -35,7 +35,7 @@ const catalogItemCreate = { 'outputType': { '$ref': '/type' }, }, 'required': ['name', 'registryId', 'images'], - 'additionalProperties': false, + 'additionalProperties': true, } const catalogItemUpdate = { @@ -60,7 +60,7 @@ const catalogItemUpdate = { 'inputType': { '$ref': '/type' }, 'outputType': { '$ref': '/type' }, }, - 'additionalProperties': false, + 'additionalProperties': true, } const image = { @@ -76,7 +76,7 @@ const image = { }, }, 'required': ['containerImage', 'fogTypeId'], - 'additionalProperties': false, + 'additionalProperties': true, } const type = { @@ -86,7 +86,7 @@ const type = { 'infoType': { 'type': 'string' }, 'infoFormat': { 'type': 'string' }, }, - 'additionalProperties': false, + 'additionalProperties': true, } module.exports = { diff --git a/src/schemas/connector.js b/src/schemas/connector.js index 67264b392..8c37ce907 100644 --- a/src/schemas/connector.js +++ b/src/schemas/connector.js @@ -23,7 +23,7 @@ const connectorCreate = { 'devMode': { 'type': 'boolean' }, }, 'required': ['publicIp', 'name', 'devMode'], - 'additionalProperties': false, + 'additionalProperties': true, } const connectorUpdate = { @@ -38,7 +38,7 @@ const connectorUpdate = { 'devMode': { 'type': 'boolean' }, }, 'required': ['publicIp'], - 'additionalProperties': false, + 'additionalProperties': true, } const connectorDelete = { @@ -48,7 +48,7 @@ const connectorDelete = { 'publicIp': { 'type': 'string', 'minLength': 7 }, }, 'required': ['publicIp'], - 'additionalProperties': false, + 'additionalProperties': true, } module.exports = { diff --git a/src/schemas/flow.js b/src/schemas/flow.js index c05dc147b..db1f86f07 100644 --- a/src/schemas/flow.js +++ b/src/schemas/flow.js @@ -7,7 +7,7 @@ const flowCreate = { 'isActivated': { 'type': 'boolean' }, }, 'required': ['name'], - 'additionalProperties': false, + 'additionalProperties': true, } const flowUpdate = { @@ -18,7 +18,7 @@ const flowUpdate = { 'description': { 'type': 'string' }, 'isActivated': { 'type': 'boolean' }, }, - 'additionalProperties': false, + 'additionalProperties': true, } module.exports = { diff --git a/src/schemas/iofog.js b/src/schemas/iofog.js index a97836e5c..112ae9e85 100644 --- a/src/schemas/iofog.js +++ b/src/schemas/iofog.js @@ -37,7 +37,7 @@ const iofogCreate = { 'fogType': { 'type': 'integer', 'minimum': 0, 'maximum': 2 }, }, 'required': ['name', 'fogType'], - 'additionalProperties': false, + 'additionalProperties': true, } const iofogUpdate = { @@ -67,7 +67,7 @@ const iofogUpdate = { 'fogType': { 'type': 'integer', 'minimum': 0, 'maximum': 2 }, }, 'required': ['uuid'], - 'additionalProperties': false, + 'additionalProperties': true, } const iofogDelete = { @@ -77,7 +77,7 @@ const iofogDelete = { 'uuid': { 'type': 'string' }, }, 'required': ['uuid'], - 'additionalProperties': false, + 'additionalProperties': true, } const iofogGet = { @@ -87,7 +87,7 @@ const iofogGet = { 'uuid': { 'type': 'string' }, }, 'required': ['uuid'], - 'additionalProperties': false, + 'additionalProperties': true, } const iofogGenerateProvision = { @@ -97,7 +97,7 @@ const iofogGenerateProvision = { 'uuid': { 'type': 'string' }, }, 'required': ['uuid'], - 'additionalProperties': false, + 'additionalProperties': true, } const iofogSetVersionCommand = { @@ -108,7 +108,7 @@ const iofogSetVersionCommand = { 'versionCommand': { 'enum': ['upgrade', 'rollback'] }, }, 'required': ['uuid', 'versionCommand'], - 'additionalProperties': false, + 'additionalProperties': true, } const iofogReboot = { @@ -118,7 +118,7 @@ const iofogReboot = { 'uuid': { 'type': 'string' }, }, 'required': ['uuid'], - 'additionalProperties': false, + 'additionalProperties': true, } const iofogFilters = { @@ -126,7 +126,7 @@ const iofogFilters = { 'type': 'array', 'items': { '$ref': '/filter' }, 'required': [], - 'additionalProperties': false, + 'additionalProperties': true, } const filter = { @@ -138,7 +138,7 @@ const filter = { 'condition': { 'enum': ['has', 'equals'] }, }, 'required': ['key', 'value', 'condition'], - 'additionalProperties': false, + 'additionalProperties': true, } const halGet = { @@ -148,7 +148,7 @@ const halGet = { 'uuid': { 'type': 'string' }, }, 'required': ['uuid'], - 'additionalProperties': false, + 'additionalProperties': true, } module.exports = { diff --git a/src/schemas/microservice.js b/src/schemas/microservice.js index ead4fbc11..653b327fc 100644 --- a/src/schemas/microservice.js +++ b/src/schemas/microservice.js @@ -33,7 +33,7 @@ const microserviceCreate = { 'items': { 'type': 'string' } }, }, 'required': ['name', 'flowId', 'catalogItemId'], - 'additionalProperties': false, + 'additionalProperties': true, } const microserviceUpdate = { @@ -60,7 +60,7 @@ const microserviceUpdate = { 'type': 'array', 'items': { 'type': 'string' } }, }, - 'additionalProperties': false, + 'additionalProperties': true, } const microserviceDelete = { @@ -70,7 +70,7 @@ const microserviceDelete = { 'withCleanup': { 'type': 'boolean', }, - 'additionalProperties': false, + 'additionalProperties': true, }, } @@ -82,7 +82,7 @@ const env = { 'value': { 'type': 'string' }, }, 'required': ['key', 'value'], - 'additionalProperties': false, + 'additionalProperties': true, } const ports = { @@ -94,7 +94,7 @@ const ports = { 'publicMode': { 'type': 'boolean' }, }, 'required': ['internal', 'external'], - 'additionalProperties': false, + 'additionalProperties': true, } const portsCreate = { @@ -106,7 +106,7 @@ const portsCreate = { 'publicMode': { 'type': 'boolean' }, }, 'required': ['internal', 'external'], - 'additionalProperties': false, + 'additionalProperties': true, } const volumeMappings = { @@ -118,7 +118,7 @@ const volumeMappings = { 'accessMode': { 'type': 'string' }, }, 'required': ['hostDestination', 'containerDestination', 'accessMode'], - 'additionalProperties': false, + 'additionalProperties': true, } module.exports = { diff --git a/src/schemas/registry.js b/src/schemas/registry.js index e9acac687..407dcc447 100644 --- a/src/schemas/registry.js +++ b/src/schemas/registry.js @@ -28,7 +28,7 @@ const registryCreate = { 'certificate': { 'type': 'string' }, }, 'required': ['url', 'isPublic', 'username', 'password', 'email'], - 'additionalProperties': false, + 'additionalProperties': true, } const registryDelete = { @@ -38,7 +38,7 @@ const registryDelete = { 'id': { 'type': 'integer' }, }, 'required': ['id'], - 'additionalProperties': false, + 'additionalProperties': true, } const registryUpdate = { @@ -57,7 +57,7 @@ const registryUpdate = { 'requiresCert': { 'type': 'boolean' }, 'certificate': { 'type': 'string' }, }, - 'additionalProperties': false, + 'additionalProperties': true, } module.exports = { diff --git a/src/schemas/user.js b/src/schemas/user.js index cd29eb953..eced2cda9 100644 --- a/src/schemas/user.js +++ b/src/schemas/user.js @@ -25,7 +25,7 @@ const signUp = { 'password': { 'type': 'string', 'minLength': 8 }, }, 'required': ['email', 'password', 'firstName', 'lastName'], - 'additionalProperties': false, + 'additionalProperties': true, } const login = { @@ -40,7 +40,7 @@ const login = { 'password': { 'type': 'string' }, }, 'required': ['email', 'password'], - 'additionalProperties': false, + 'additionalProperties': true, } const resendActivation = { @@ -54,7 +54,7 @@ const resendActivation = { }, }, 'required': ['email'], - 'additionalProperties': false, + 'additionalProperties': true, } const activateUser = { @@ -64,7 +64,7 @@ const activateUser = { 'activationCode': { 'type': 'string' }, }, 'required': ['activationCode'], - 'additionalProperties': false, + 'additionalProperties': true, } const activateUserCLI = { @@ -74,7 +74,7 @@ const activateUserCLI = { 'email': { 'type': 'string' }, }, 'required': ['email'], - 'additionalProperties': false, + 'additionalProperties': true, } const updateUserProfile = { @@ -85,7 +85,7 @@ const updateUserProfile = { 'lastName': { 'type': 'string', 'minLength': 3 }, }, 'required': [], - 'additionalProperties': false, + 'additionalProperties': true, } const updateUserProfileCLI = { @@ -97,7 +97,7 @@ const updateUserProfileCLI = { 'password': { 'type': 'string', 'minLength': 8 }, }, 'required': [], - 'additionalProperties': false, + 'additionalProperties': true, } const updatePassword = { @@ -108,7 +108,7 @@ const updatePassword = { 'newPassword': { 'type': 'string', 'minLength': 8 }, }, 'required': ['oldPassword', 'newPassword'], - 'additionalProperties': false, + 'additionalProperties': true, } const resetUserPassword = { @@ -122,7 +122,7 @@ const resetUserPassword = { }, }, 'required': ['email'], - 'additionalProperties': false, + 'additionalProperties': true, }