diff --git a/src/api-docs/paths/path-admin.js b/src/api-docs/paths/path-admin.js index d3578fe..0f70ff8 100644 --- a/src/api-docs/paths/path-admin.js +++ b/src/api-docs/paths/path-admin.js @@ -253,7 +253,10 @@ export default { type: 'object', properties: { token: { - refreshToken: 'string' + type: 'string' + }, + refreshToken: { + type: 'string' } } } diff --git a/src/api-docs/paths/path-client.js b/src/api-docs/paths/path-client.js index 66b9e08..d8800b4 100644 --- a/src/api-docs/paths/path-client.js +++ b/src/api-docs/paths/path-client.js @@ -9,10 +9,10 @@ export default { description: 'Execute criteria query against the API settings', security: [{ appAuth: [] }], parameters: [ - queryParameter('key', 'string', 'Switcher Key', true), - queryParameter('showReason', 'boolean', 'Show criteria execution reason (default: true)', false), - queryParameter('showStrategy', 'boolean', 'Show criteria execution strategy (default: true)', false), - queryParameter('bypassMetric', 'boolean', 'Bypass metric check (default: true)', false) + queryParameter('key', 'Switcher Key', true, 'string'), + queryParameter('showReason', 'Show criteria execution reason (default: true)', false, 'boolean'), + queryParameter('showStrategy', 'Show criteria execution strategy (default: true)', false, 'boolean'), + queryParameter('bypassMetric', 'Bypass metric check (default: true)', false, 'boolean') ], requestBody: { content: { @@ -56,7 +56,7 @@ export default { }, strategies: { type: 'array', - items: configStrategy + items: configStrategy.ConfigStrategy } } } @@ -66,13 +66,13 @@ export default { } } }, - '/criteria/snapshot_check/:version': { + '/criteria/snapshot_check/{version}': { get: { tags: ['Client API'], description: 'Check if snapshot version is up to date', security: [{ appAuth: [] }], parameters: [ - pathParameter('version', 'string', 'Snapshot version', true) + pathParameter('version', 'Snapshot version', true) ], responses: { 200: { diff --git a/src/api-docs/paths/path-component.js b/src/api-docs/paths/path-component.js index 1cebda3..0d17234 100644 --- a/src/api-docs/paths/path-component.js +++ b/src/api-docs/paths/path-component.js @@ -18,13 +18,13 @@ export default { } } }, - '/component/generateApiKey/:component/': { + '/component/generateApiKey/{component}': { get: { tags: ['Component'], description: 'Generate an API key for a component', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('component', 'Component ID', 'string', true) + pathParameter('component', 'Component ID', true) ], responses: { 200: { @@ -51,7 +51,7 @@ export default { description: 'Get all components', security: [{ bearerAuth: [] }], parameters: [ - queryParameter('domain', 'Domain ID', 'string', true), + queryParameter('domain', 'Domain ID', true, 'string'), ...pagination ], responses: { @@ -62,13 +62,13 @@ export default { } } }, - '/component/:id': { + '/component/{id}': { get: { tags: ['Component'], description: 'Get a component', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'Component ID', 'string', true) + pathParameter('id', 'Component ID', true) ], responses: { 200: { @@ -82,7 +82,7 @@ export default { description: 'Update a component', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'Component ID', 'string', true), + pathParameter('id', 'Component ID', true), ], requestBody: { content: { @@ -113,7 +113,7 @@ export default { description: 'Delete a component', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'Component ID', 'string', true) + pathParameter('id', 'Component ID', true) ], responses: { 200: { diff --git a/src/api-docs/paths/path-config-strategy.js b/src/api-docs/paths/path-config-strategy.js index db087fc..2e77cfa 100644 --- a/src/api-docs/paths/path-config-strategy.js +++ b/src/api-docs/paths/path-config-strategy.js @@ -37,7 +37,7 @@ export default { } } }, - '/configstrategy/:id': { + '/configstrategy/{id}': { get: { tags: ['ConfigStrategy'], description: 'Get a Config Strategy', @@ -105,7 +105,7 @@ export default { } } }, - '/configstrategy/history/:id': { + '/configstrategy/history/{id}': { get: { tags: ['ConfigStrategy'], description: 'Get a Config Strategy history', @@ -136,7 +136,7 @@ export default { } } }, - '/configstrategy/req/:strategy': { + '/configstrategy/req/{strategy}': { get: { tags: ['ConfigStrategy'], description: 'Get Config Strategy requirements specification', @@ -172,11 +172,13 @@ export default { 'application/json': { schema: { type: 'object', - strategiesAvailable: { - type: 'array', - items: { - type: 'string', - enum: Object.values(StrategiesType) + properties: { + strategiesAvailable: { + type: 'array', + items: { + type: 'string', + enum: Object.values(StrategiesType) + } } } } @@ -186,7 +188,7 @@ export default { } } }, - '/configstrategy/addval/:id': { + '/configstrategy/addval/{id}': { patch: { tags: ['ConfigStrategy'], description: 'Add a value to a Config Strategy', @@ -216,7 +218,7 @@ export default { } } }, - '/configstrategy/updateval/:id': { + '/configstrategy/updateval/{id}': { patch: { tags: ['ConfigStrategy'], description: 'Update a value of a Config Strategy', @@ -249,7 +251,7 @@ export default { } } }, - '/configstrategy/removeval/:id': { + '/configstrategy/removeval/{id}': { patch: { tags: ['ConfigStrategy'], description: 'Remove a value of a Config Strategy', @@ -279,7 +281,7 @@ export default { } } }, - '/configstrategy/values/:id': { + '/configstrategy/values/{id}': { get: { tags: ['ConfigStrategy'], description: 'Get a Config Strategy values', @@ -305,7 +307,7 @@ export default { } } }, - '/configstrategy/updateStatus/:id': { + '/configstrategy/updateStatus/{id}': { patch: { tags: ['ConfigStrategy'], description: 'Update a Config Strategy status', diff --git a/src/api-docs/paths/path-config.js b/src/api-docs/paths/path-config.js index 8bd0024..b520300 100644 --- a/src/api-docs/paths/path-config.js +++ b/src/api-docs/paths/path-config.js @@ -324,7 +324,7 @@ export default { parameters: [ ...pagination, queryParameter('group', 'Group ID', true), - queryParameter('fields', 'Fields to return', false, 'string', 'E.g.: key,description,activated.default') + queryParameter('fields', 'Fields to return - E.g.: key,description,activated.default', false, 'string') ], responses: { '200': { @@ -339,7 +339,10 @@ export default { tags: ['Config'], description: 'Get Config history', security: [{ bearerAuth: [] }], - parameters: [...pagination], + parameters: [ + pathParameter('id', 'Config ID', true), + ...pagination + ], responses: { '200': { description: 'Success', @@ -351,6 +354,9 @@ export default { tags: ['Config'], description: 'Delete Config history', security: [{ bearerAuth: [] }], + parameters: [ + pathParameter('id', 'Config ID', true) + ], responses: { '200': { description: 'Success', diff --git a/src/api-docs/paths/path-domain.js b/src/api-docs/paths/path-domain.js index ba9f436..c9c1bc1 100644 --- a/src/api-docs/paths/path-domain.js +++ b/src/api-docs/paths/path-domain.js @@ -2,7 +2,7 @@ import { pagination, pathParameter } from '../schemas/common'; import { commonArraySchemaContent, commonSchemaContent } from './common'; export default { - 'domain/create': { + '/domain/create': { post: { tags: ['Domain'], description: 'Domain creation', @@ -225,7 +225,10 @@ export default { tags: ['Domain'], description: 'Get domain history', security: [{ bearerAuth: [] }], - parameters: [...pagination], + parameters: [ + pathParameter('id', 'Domain ID', true), + ...pagination + ], responses: { '200': { description: 'Success', @@ -237,6 +240,9 @@ export default { tags: ['Domain'], description: 'Delete domain history', security: [{ bearerAuth: [] }], + parameters: [ + pathParameter('id', 'Domain ID', true) + ], responses: { '200': { description: 'Success', diff --git a/src/api-docs/paths/path-environment.js b/src/api-docs/paths/path-environment.js index ab46a41..c5fad9c 100644 --- a/src/api-docs/paths/path-environment.js +++ b/src/api-docs/paths/path-environment.js @@ -24,7 +24,7 @@ export default { description: 'Get all environments', security: [{ bearerAuth: [] }], parameters: [ - queryParameter('domain', 'Domain ID', 'string', true), + queryParameter('domain', 'Domain ID', true, 'string'), ...pagination ], responses: { @@ -35,13 +35,13 @@ export default { } } }, - '/environment/:id': { + '/environment/{id}': { get: { tags: ['Environment'], description: 'Get an environment', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'Environment ID', 'string', true) + pathParameter('id', 'Environment ID', true) ], responses: { 200: { @@ -55,7 +55,7 @@ export default { description: 'Delete an environment', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'Environment ID', 'string', true) + pathParameter('id', 'Environment ID', true) ], responses: { 200: { @@ -65,13 +65,13 @@ export default { } } }, - '/environment/recover/:id': { + '/environment/recover/{id}': { patch: { tags: ['Environment'], description: 'Recover an environment', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'Environment ID', 'string', true) + pathParameter('id', 'Environment ID', true) ], responses: { 200: { diff --git a/src/api-docs/paths/path-group-config.js b/src/api-docs/paths/path-group-config.js index bdf9544..2e0c11f 100644 --- a/src/api-docs/paths/path-group-config.js +++ b/src/api-docs/paths/path-group-config.js @@ -24,7 +24,7 @@ export default { description: 'Get all group configs', security: [{ bearerAuth: [] }], parameters: [ - queryParameter('domain', 'Domain ID', 'string', true), + queryParameter('domain', 'Domain ID', true, 'string'), ...pagination ], responses: { @@ -35,13 +35,13 @@ export default { } } }, - '/groupconfig/:id': { + '/groupconfig/{id}': { get: { tags: ['GroupConfig'], description: 'Get a group config', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'GroupConfig ID', 'string', true) + pathParameter('id', 'GroupConfig ID', true) ], responses: { 200: { @@ -55,7 +55,7 @@ export default { description: 'Delete a group config', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'GroupConfig ID', 'string', true) + pathParameter('id', 'GroupConfig ID', true) ], responses: { 200: { @@ -69,7 +69,7 @@ export default { description: 'Update a group config', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'GroupConfig ID', 'string', true) + pathParameter('id', 'GroupConfig ID', true) ], requestBody: { content: { @@ -96,13 +96,13 @@ export default { } } }, - '/groupconfig/history/:id': { + '/groupconfig/history/{id}': { get: { tags: ['GroupConfig'], description: 'Get a Group Config history', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'GroupConfig ID', 'string', true), + pathParameter('id', 'GroupConfig ID', true), ...pagination ], responses: { @@ -117,7 +117,7 @@ export default { description: 'Delete a group config history', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'GroupConfig ID', 'string', true) + pathParameter('id', 'GroupConfig ID', true) ], responses: { 200: { @@ -127,7 +127,7 @@ export default { } } }, - '/groupconfig/updateStatus/:id': { + '/groupconfig/updateStatus/{id}': { patch: { tags: ['GroupConfig'], description: 'Group Config environment update', diff --git a/src/api-docs/paths/path-metric.js b/src/api-docs/paths/path-metric.js index 08bd228..f259923 100644 --- a/src/api-docs/paths/path-metric.js +++ b/src/api-docs/paths/path-metric.js @@ -2,23 +2,23 @@ import { queryParameter } from '../schemas/common'; import { commonSchemaContent } from './common'; export default { - '/metric/data/': { + '/metric/data': { get: { tags: ['Metric'], description: 'Get metrics data', security: [{ bearerAuth: [] }], parameters: [ - queryParameter('domainid', 'The domain id', 'string', true), - queryParameter('page', 'The page number', 'integer', true), - queryParameter('key', 'Switcher Key', 'string', false), - queryParameter('group', 'Group name', 'string', false), - queryParameter('component', 'Component name', 'string', false), - queryParameter('result', 'Result', 'boolean', false), - queryParameter('environment', 'Environment', 'string', false), - queryParameter('dateGroupPattern', 'Date group pattern', 'string', false), - queryParameter('dateAfter', 'Date after', 'string', false), - queryParameter('dateBefore', 'Date before', 'string', false), - queryParameter('sortBy', 'Sort by | Can add params separated by ;', 'string', false) + queryParameter('domainid', 'The domain id', true, 'string'), + queryParameter('page', 'The page number', true, 'integer'), + queryParameter('key', 'Switcher Key', false, 'string'), + queryParameter('group', 'Group name', false, 'string'), + queryParameter('component', 'Component name', false, 'string'), + queryParameter('result', 'Result', false, 'boolean'), + queryParameter('environment', 'Environment', false, 'string'), + queryParameter('dateGroupPattern', 'Date group pattern', false, 'string'), + queryParameter('dateAfter', 'Date after', false, 'string'), + queryParameter('dateBefore', 'Date before', false, 'string'), + queryParameter('sortBy', 'Sort by | Can add params separated by ;', false, 'string') ], responses: { 200: { @@ -28,23 +28,23 @@ export default { } } }, - '/metric/statistics/': { + '/metric/statistics': { get: { tags: ['Metric'], description: 'Get metrics statistics', security: [{ bearerAuth: [] }], parameters: [ - queryParameter('domainid', 'The domain id', 'string', true), - queryParameter('statistics', '[switchers, components, reasons, all]', 'string', true), - queryParameter('key', 'Switcher Key', 'string', false), - queryParameter('group', 'Group name', 'string', false), - queryParameter('component', 'Component name', 'string', false), - queryParameter('result', 'Result', 'boolean', false), - queryParameter('environment', 'Environment', 'string', false), - queryParameter('dateGroupPattern', 'Date group pattern', 'string', false), - queryParameter('dateAfter', 'Date after', 'string', false), - queryParameter('dateBefore', 'Date before', 'string', false), - queryParameter('sortBy', 'Sort by | Can add params separated by ;', 'string', false) + queryParameter('domainid', 'The domain id', true, 'string'), + queryParameter('statistics', '[switchers, components, reasons, all]', true, 'string'), + queryParameter('key', 'Switcher Key', false, 'string'), + queryParameter('group', 'Group name', false, 'string'), + queryParameter('component', 'Component name', false, 'string'), + queryParameter('result', 'Result', false, 'boolean'), + queryParameter('environment', 'Environment', false, 'string'), + queryParameter('dateGroupPattern', 'Date group pattern', false, 'string'), + queryParameter('dateAfter', 'Date after', false, 'string'), + queryParameter('dateBefore', 'Date before', false, 'string'), + queryParameter('sortBy', 'Sort by | Can add params separated by ;', false, 'string') ], responses: { 200: { @@ -60,8 +60,8 @@ export default { description: 'Delete metrics', security: [{ bearerAuth: [] }], parameters: [ - queryParameter('domainid', 'The domain id', 'string', true), - queryParameter('key', 'Switcher Key', 'string', true) + queryParameter('domainid', 'The domain id', true, 'string'), + queryParameter('key', 'Switcher Key', true, 'string') ], responses: { 200: { diff --git a/src/api-docs/paths/path-permission.js b/src/api-docs/paths/path-permission.js index 18645a0..f9798da 100644 --- a/src/api-docs/paths/path-permission.js +++ b/src/api-docs/paths/path-permission.js @@ -3,13 +3,13 @@ import { pathParameter, queryParameter } from '../schemas/common'; import { commonArraySchemaContent, commonSchemaContent } from './common'; export default { - '/permission/create/:team': { + '/permission/create/{team}': { post: { tags: ['Permission'], description: 'Create a new permission', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('team', 'Team ID', 'string', true) + pathParameter('team', 'Team ID', true) ], requestBody: { content: commonSchemaContent('Permission') @@ -50,13 +50,13 @@ export default { } } }, - '/permission/spec/router/:router': { + '/permission/spec/router/{router}': { get: { tags: ['Permission'], description: 'Get key available for a router', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('router', 'Router Name', 'string', true) + pathParameter('router', 'Router Name', true) ], responses: { 200: { @@ -111,7 +111,7 @@ export default { description: 'Get all permissions', security: [{ bearerAuth: [] }], parameters: [ - queryParameter('team', 'Team ID', 'string', true) + queryParameter('team', 'Team ID', true, 'string') ], responses: { 200: { @@ -121,13 +121,13 @@ export default { } } }, - '/permission/:id': { + '/permission/{id}': { get: { tags: ['Permission'], description: 'Get a permission', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'Permission ID', 'string', true) + pathParameter('id', 'Permission ID', true) ], responses: { 200: { @@ -141,7 +141,7 @@ export default { description: 'Update a permission', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'Permission ID', 'string', true) + pathParameter('id', 'Permission ID', true) ], requestBody: { content: commonSchemaContent('PermissionUpdateRequest') @@ -158,7 +158,7 @@ export default { description: 'Delete a permission', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'Permission ID', 'string', true) + pathParameter('id', 'Permission ID', true) ], responses: { 200: { @@ -168,13 +168,13 @@ export default { } } }, - '/permission/value/add/:id': { + '/permission/value/add/{id}': { patch: { tags: ['Permission'], description: 'Add a value to a permission', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'Permission ID', 'string', true) + pathParameter('id', 'Permission ID', true) ], requestBody: { content: { @@ -198,13 +198,13 @@ export default { } } }, - '/permission/value/remove/:id': { + '/permission/value/remove/{id}': { patch: { tags: ['Permission'], description: 'Remove a value from a permission', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'Permission ID', 'string', true) + pathParameter('id', 'Permission ID', true) ], requestBody: { content: { @@ -228,13 +228,13 @@ export default { } } }, - '/permission/updateValues/:id': { + '/permission/updateValues/{id}': { patch: { tags: ['Permission'], description: 'Update values of a permission', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('id', 'Permission ID', 'string', true) + pathParameter('id', 'Permission ID', true) ], requestBody: { content: commonSchemaContent('Permission') diff --git a/src/api-docs/paths/path-slack.js b/src/api-docs/paths/path-slack.js index 693bf42..939a0b4 100644 --- a/src/api-docs/paths/path-slack.js +++ b/src/api-docs/paths/path-slack.js @@ -22,7 +22,7 @@ export default { description: 'Delete a slack installation', security: [{ slackAuth: [] }], parameters: [ - queryParameter('team_id', 'The team id', 'string', true) + queryParameter('team_id', 'The team id', true, 'string') ], responses: { 200: { @@ -147,7 +147,7 @@ export default { description: 'Find the bot', security: [{ slackAuth: [] }], parameters: [ - queryParameter('team_id', 'The Slack team ID', 'string', true) + queryParameter('team_id', 'The Slack team ID', true, 'string') ], responses: { 200: { @@ -163,7 +163,7 @@ export default { description: 'Find the installation without checking the domain', security: [{ slackAuth: [] }], parameters: [ - queryParameter('team_id', 'The Slack team ID', 'string', true) + queryParameter('team_id', 'The Slack team ID', true, 'string') ], responses: { 200: { @@ -179,7 +179,7 @@ export default { description: 'Find the installation', security: [{ bearerAuth: [] }], parameters: [ - queryParameter('team_id', 'The Slack team ID', 'string', true) + queryParameter('team_id', 'The Slack team ID', true, 'string') ], responses: { 200: { @@ -189,13 +189,13 @@ export default { } } }, - '/slack/v1/installation/:domain': { + '/slack/v1/installation/{domain}': { get: { tags: ['Switcher Slack App'], description: 'Return complete installation and settings given a domain ID', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('domain', 'The domain ID', 'string', true) + pathParameter('domain', 'The domain ID', true) ], responses: { 200: { @@ -211,7 +211,7 @@ export default { description: 'Decline the installation', security: [{ bearerAuth: [] }], parameters: [ - queryParameter('team_id', 'The Slack team ID', 'string', true) + queryParameter('team_id', 'The Slack team ID', true, 'string') ], responses: { 200: { @@ -227,7 +227,7 @@ export default { description: 'Unlink the installation', security: [{ bearerAuth: [] }], parameters: [ - queryParameter('domain', 'Domain ID', 'string', true) + queryParameter('domain', 'Domain ID', true, 'string') ], responses: { 200: { @@ -237,14 +237,14 @@ export default { } } }, - '/slack/v1/settings/:param/:domain': { + '/slack/v1/settings/{param}/{domain}': { patch: { tags: ['Switcher Slack App'], description: 'Update Slack Installation settings given a parameter', security: [{ bearerAuth: [] }], parameters: [ - pathParameter('param', 'Parameter to be updated', 'string', true), - pathParameter('domain', 'The domain ID', 'string', true) + pathParameter('param', 'Parameter to be updated', true), + pathParameter('domain', 'The domain ID', true) ], responses: { 200: { diff --git a/src/api-docs/paths/path-team.js b/src/api-docs/paths/path-team.js index bb296a7..487bd25 100644 --- a/src/api-docs/paths/path-team.js +++ b/src/api-docs/paths/path-team.js @@ -38,7 +38,7 @@ export default { description: 'Get all teams', security: [{ bearerAuth: [] }], parameters: [ - queryParameter('domain', 'string', 'Domain ID', true), + queryParameter('domain', 'Domain ID', true, 'string'), ...pagination ], responses: { @@ -49,7 +49,7 @@ export default { } } }, - '/team/:id': { + '/team/{id}': { get: { tags: ['Team'], description: 'Get single team', @@ -110,7 +110,7 @@ export default { } } }, - '/team/member/invite/:id': { + '/team/member/invite/{id}': { post: { tags: ['Team'], description: 'Invite member to team', @@ -170,7 +170,7 @@ export default { } } }, - '/team/member/invite/pending/:id': { + '/team/member/invite/pending/{id}': { get: { tags: ['Team'], description: 'Get pending invites', @@ -186,7 +186,7 @@ export default { } } }, - '/team/member/invite/accept/:request_id': { + '/team/member/invite/accept/{request_id}': { post: { tags: ['Team'], description: 'Accept invite', @@ -202,7 +202,7 @@ export default { } } }, - '/team/member/invite/remove/:id/:request_id': { + '/team/member/invite/remove/{id}/{request_id}': { delete: { tags: ['Team'], description: 'Remove invite', @@ -219,7 +219,7 @@ export default { } } }, - '/team/member/add/:id': { + '/team/member/add/{id}': { patch: { tags: ['Team'], description: 'Add member to team', @@ -250,7 +250,7 @@ export default { } } }, - '/team/member/remove/:id': { + '/team/member/remove/{id}': { patch: { tags: ['Team'], description: 'Remove member from team', @@ -281,7 +281,7 @@ export default { } } }, - '/team/permission/remove/:id': { + '/team/permission/remove/{id}': { patch: { tags: ['Team'], description: 'Remove permission from team', diff --git a/src/api-docs/schemas/component.js b/src/api-docs/schemas/component.js index 231dbd0..052b3aa 100644 --- a/src/api-docs/schemas/component.js +++ b/src/api-docs/schemas/component.js @@ -14,12 +14,12 @@ export const component = { description: 'The description of the component' }, domain: { - type: 'uuid', + type: 'string', description: 'The domain ID parent of the component', format: 'uuid' }, owner: { - type: 'uuid', + type: 'string', description: 'The owner id of the component' }, apihash: { diff --git a/src/api-docs/schemas/config-strategy.js b/src/api-docs/schemas/config-strategy.js index 9ab0633..1868eb0 100644 --- a/src/api-docs/schemas/config-strategy.js +++ b/src/api-docs/schemas/config-strategy.js @@ -1,6 +1,6 @@ import { OperationsType, StrategiesType } from '../../models/config-strategy'; -export const configStrategy = { +const configStrategy = { type: 'object', properties: { _id: { @@ -22,9 +22,12 @@ export const configStrategy = { type: 'string', enum: Object.values(StrategiesType) }, - values: [{ - type: 'string' - }], + values: { + type: 'array', + items: { + type: 'string' + } + }, operation: { type: 'string', enum: Object.values(OperationsType) @@ -40,14 +43,14 @@ export const configStrategy = { format: 'uuid' }, owner: { - type: 'uuid', + type: 'string', description: 'The owner id of the config strategy' }, admin: { type: 'object', properties: { _id: { - type: 'uuid', + type: 'string', description: 'The unique identifier of the admin' }, name: { @@ -80,9 +83,12 @@ export default { type: 'string', enum: Object.values(StrategiesType) }, - values: [{ - type: 'string' - }], + values: { + type: 'array', + items: { + type: 'string' + } + }, operation: { type: 'string', enum: Object.values(OperationsType) diff --git a/src/api-docs/schemas/config.js b/src/api-docs/schemas/config.js index d973d24..7714476 100644 --- a/src/api-docs/schemas/config.js +++ b/src/api-docs/schemas/config.js @@ -4,7 +4,7 @@ const configComponents = { type: 'array', description: 'The component IDs that can use the Swichter', items: { - type: 'uuid' + type: 'string' } }; @@ -87,14 +87,14 @@ export const config = (components) => ({ format: 'uuid' }, owner: { - type: 'uuid', + type: 'string', description: 'The owner id of the config' }, admin: { type: 'object', properties: { _id: { - type: 'uuid', + type: 'string', description: 'The unique identifier of the admin' }, name: { diff --git a/src/api-docs/schemas/domain.js b/src/api-docs/schemas/domain.js index 4704e3f..c517205 100644 --- a/src/api-docs/schemas/domain.js +++ b/src/api-docs/schemas/domain.js @@ -6,7 +6,7 @@ export const domain = { description: 'The unique identifier of the domain' }, integrations: { - type: 'obejct', + type: 'object', properties: { slack: { type: 'string', @@ -39,14 +39,14 @@ export const domain = { } }, owner: { - type: 'uuid', + type: 'string', description: 'The owner id of the domain' }, admin: { type: 'object', properties: { _id: { - type: 'uuid', + type: 'string', description: 'The unique identifier of the admin' }, name: { diff --git a/src/api-docs/schemas/environment.js b/src/api-docs/schemas/environment.js index 1b4d227..fc9cca3 100644 --- a/src/api-docs/schemas/environment.js +++ b/src/api-docs/schemas/environment.js @@ -14,7 +14,7 @@ const environment = { format: 'uuid' }, owner: { - type: 'uuid', + type: 'string', description: 'The owner id of the environment' }, createdAt: { diff --git a/src/api-docs/schemas/group-config.js b/src/api-docs/schemas/group-config.js index 10cb0d0..f97314a 100644 --- a/src/api-docs/schemas/group-config.js +++ b/src/api-docs/schemas/group-config.js @@ -24,14 +24,14 @@ const groupConfig = { format: 'uuid' }, owner: { - type: 'uuid', + type: 'string', description: 'The owner id of the config' }, admin: { type: 'object', properties: { _id: { - type: 'uuid', + type: 'string', description: 'The unique identifier of the admin' }, name: { diff --git a/src/api-docs/schemas/slack.js b/src/api-docs/schemas/slack.js index aa6a1e9..9de89fa 100644 --- a/src/api-docs/schemas/slack.js +++ b/src/api-docs/schemas/slack.js @@ -125,7 +125,7 @@ const installation_payload = { description: 'Is enterprise install' }, installed_at: { - type: 'double', + type: 'number', description: 'The date installed' } } diff --git a/src/api-docs/swagger-document.js b/src/api-docs/swagger-document.js index 8c3824a..feb5f0a 100644 --- a/src/api-docs/swagger-document.js +++ b/src/api-docs/swagger-document.js @@ -54,8 +54,7 @@ export default { }, appAuth: { type: 'http', - scheme: 'bearer', - name: 'JWT' + scheme: 'bearer' }, apiKey: { type: 'apiKey',