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 { dateSchema } from './date-schema';
export const bulkRegistrationSchema = {
$id: '#/components/schemas/bulkRegistrationSchema',
@ -8,7 +9,16 @@ export const bulkRegistrationSchema = {
connectVia: {
type: 'array',
items: {
type: 'string',
type: 'object',
required: ['appName', 'instanceId'],
properties: {
appName: {
type: 'string',
},
instanceId: {
type: 'string',
},
},
},
},
appName: {
@ -24,7 +34,7 @@ export const bulkRegistrationSchema = {
type: 'number',
},
started: {
type: 'number',
$ref: '#/components/schemas/dateSchema',
},
strategies: {
type: 'array',
@ -37,7 +47,9 @@ export const bulkRegistrationSchema = {
},
},
components: {
schemas: {},
schemas: {
dateSchema,
},
},
} as const;

View File

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