1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00

chore: Improve bulk metrics endpoint (#3213)

## About the changes
This adds support for connectVia the way we intend to use it and start
now supports also a string
This commit is contained in:
Gastón Fournier 2023-02-28 14:36:25 +01:00 committed by GitHub
parent 8ebe62db05
commit 0916402abf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 5 deletions

View File

@ -1,4 +1,5 @@
import { FromSchema } from 'json-schema-to-ts'; import { FromSchema } from 'json-schema-to-ts';
import { dateSchema } from './date-schema';
export const bulkRegistrationSchema = { export const bulkRegistrationSchema = {
$id: '#/components/schemas/bulkRegistrationSchema', $id: '#/components/schemas/bulkRegistrationSchema',
@ -8,8 +9,17 @@ export const bulkRegistrationSchema = {
connectVia: { connectVia: {
type: 'array', type: 'array',
items: { items: {
type: 'object',
required: ['appName', 'instanceId'],
properties: {
appName: {
type: 'string', type: 'string',
}, },
instanceId: {
type: 'string',
},
},
},
}, },
appName: { appName: {
type: 'string', type: 'string',
@ -24,7 +34,7 @@ export const bulkRegistrationSchema = {
type: 'number', type: 'number',
}, },
started: { started: {
type: 'number', $ref: '#/components/schemas/dateSchema',
}, },
strategies: { strategies: {
type: 'array', type: 'array',
@ -37,7 +47,9 @@ export const bulkRegistrationSchema = {
}, },
}, },
components: { components: {
schemas: {}, schemas: {
dateSchema,
},
}, },
} as const; } as const;

View File

@ -352,8 +352,20 @@ exports[`should serve the OpenAPI spec 1`] = `
}, },
"connectVia": { "connectVia": {
"items": { "items": {
"properties": {
"appName": {
"type": "string", "type": "string",
}, },
"instanceId": {
"type": "string",
},
},
"required": [
"appName",
"instanceId",
],
"type": "object",
},
"type": "array", "type": "array",
}, },
"environment": { "environment": {
@ -369,7 +381,7 @@ exports[`should serve the OpenAPI spec 1`] = `
"type": "string", "type": "string",
}, },
"started": { "started": {
"type": "number", "$ref": "#/components/schemas/dateSchema",
}, },
"strategies": { "strategies": {
"items": { "items": {