2022-06-08 08:01:14 +02:00
|
|
|
import { FromSchema } from 'json-schema-to-ts';
|
2022-04-25 14:17:59 +02:00
|
|
|
|
2022-06-08 08:01:14 +02:00
|
|
|
export const overrideSchema = {
|
|
|
|
$id: '#/components/schemas/overrideSchema',
|
2022-04-25 14:17:59 +02:00
|
|
|
type: 'object',
|
2022-04-29 08:09:27 +02:00
|
|
|
additionalProperties: false,
|
2022-04-25 14:17:59 +02:00
|
|
|
required: ['contextName', 'values'],
|
2023-06-14 14:19:00 +02:00
|
|
|
description:
|
|
|
|
'An override for deciding which variant should be assigned to a user based on the context name',
|
2022-04-25 14:17:59 +02:00
|
|
|
properties: {
|
|
|
|
contextName: {
|
2023-06-14 14:19:00 +02:00
|
|
|
description:
|
|
|
|
'The name of the context field used to determine overrides',
|
2022-04-25 14:17:59 +02:00
|
|
|
type: 'string',
|
2023-06-14 14:19:00 +02:00
|
|
|
example: 'userId',
|
2022-04-25 14:17:59 +02:00
|
|
|
},
|
|
|
|
values: {
|
2023-06-14 14:19:00 +02:00
|
|
|
description: 'Which values that should be overriden',
|
2022-04-25 14:17:59 +02:00
|
|
|
type: 'array',
|
|
|
|
items: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
2023-06-14 14:19:00 +02:00
|
|
|
example: ['red', 'blue'],
|
2022-04-25 14:17:59 +02:00
|
|
|
},
|
|
|
|
},
|
2022-06-08 08:01:14 +02:00
|
|
|
components: {},
|
2022-04-25 14:17:59 +02:00
|
|
|
} as const;
|
|
|
|
|
2022-06-08 08:01:14 +02:00
|
|
|
export type OverrideSchema = FromSchema<typeof overrideSchema>;
|