1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/src/lib/openapi/spec/create-context-field-schema.ts
Thomas Heartman 4ab8accf5c
OpenAPI: remaining schema updates (#4354)
This fixes the last few exceptions to our meta schema validation
2023-07-28 07:25:34 +00:00

22 lines
682 B
TypeScript

import { FromSchema } from 'json-schema-to-ts';
import { updateContextFieldSchema } from './update-context-field-schema';
export const createContextFieldSchema = {
...updateContextFieldSchema,
$id: '#/components/schemas/createContextFieldSchema',
description: 'Data used to create a context field configuration.',
required: ['name'],
properties: {
...updateContextFieldSchema.properties,
name: {
description: 'The name of the context field.',
type: 'string',
example: 'subscriptionTier',
},
},
} as const;
export type CreateContextFieldSchema = FromSchema<
typeof createContextFieldSchema
>;