1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-11-01 19:07:38 +01:00
unleash.unleash/src/lib/openapi/spec/feature-metrics-schema.ts
Christopher Kolstad 1b248a03e9
docs: Metrics tag openapi docs (#3572)
I've copied most of the descriptions from what we did for batch metrics
under the Edge tag, however there are a couple of top level descriptions
that are "fine" but I'm definitely open to suggestions.

---------

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2023-04-26 12:10:57 +02:00

40 lines
1.2 KiB
TypeScript

import { FromSchema } from 'json-schema-to-ts';
import { featureEnvironmentMetricsSchema } from './feature-environment-metrics-schema';
import { dateSchema } from './date-schema';
export const featureMetricsSchema = {
$id: '#/components/schemas/featureMetricsSchema',
type: 'object',
additionalProperties: false,
required: ['version', 'maturity', 'data'],
description: 'A batch of feature metrics',
properties: {
version: {
description: 'The version of this schema',
type: 'integer',
minimum: 1,
},
maturity: {
description:
'The maturity level of this API (alpha, beta, stable, deprecated)',
type: 'string',
example: 'stable',
},
data: {
description: 'Metrics gathered per environment',
type: 'array',
items: {
$ref: '#/components/schemas/featureEnvironmentMetricsSchema',
},
},
},
components: {
schemas: {
featureEnvironmentMetricsSchema,
dateSchema,
},
},
} as const;
export type FeatureMetricsSchema = FromSchema<typeof featureMetricsSchema>;