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/ui-config-schema.ts
Tymoteusz Czech 2729999bed
Feat: OpenAPI controller - Bootstrap UI (#1773)
* rename bootstrap ui controller

* sort openapi schema imports

* add bootstrap ui json schema

* test bootstrap ui schema

* openapi bootstrap ui route

* fix: bootstrap ui schema type

* bootstrap ui e2e test

* simplify bootstrap-ui testing mock

* fix: update after review
2022-06-30 12:21:40 +00:00

72 lines
1.6 KiB
TypeScript

import { FromSchema } from 'json-schema-to-ts';
import { versionSchema } from './version-schema';
export const uiConfigSchema = {
$id: '#/components/schemas/uiConfigSchema',
type: 'object',
additionalProperties: false,
required: ['version', 'unleashUrl', 'baseUriPath', 'versionInfo'],
properties: {
slogan: {
type: 'string',
},
name: {
type: 'string',
},
version: {
type: 'string',
},
environment: {
type: 'string',
},
unleashUrl: {
type: 'string',
},
baseUriPath: {
type: 'string',
},
disablePasswordAuth: {
type: 'boolean',
},
segmentValuesLimit: {
type: 'number',
},
strategySegmentsLimit: {
type: 'number',
},
flags: {
type: 'object',
additionalProperties: {
type: 'boolean',
},
},
links: {
type: 'array',
items: {
type: 'object',
},
},
authenticationType: {
type: 'string',
enum: [
'open-source',
'demo',
'enterprise',
'hosted',
'custom',
'none',
],
},
versionInfo: {
$ref: '#/components/schemas/versionSchema',
},
},
components: {
schemas: {
versionSchema,
},
},
} as const;
export type UiConfigSchema = FromSchema<typeof uiConfigSchema>;