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