mirror of
https://github.com/Unleash/unleash.git
synced 2024-11-01 19:07:38 +01:00
adface17c7
* refactor: normalize controller file names * refactor: throw invalid responses in dev mode * refactor: add OpenAPI schema to environments controller * refactor: improve JSON schema prop removal code * refactor: fix empty response specs
28 lines
708 B
TypeScript
28 lines
708 B
TypeScript
import { FromSchema } from 'json-schema-to-ts';
|
|
import { environmentSchema } from './environment-schema';
|
|
|
|
export const environmentsSchema = {
|
|
$id: '#/components/schemas/environmentsSchema',
|
|
type: 'object',
|
|
additionalProperties: false,
|
|
required: ['version', 'environments'],
|
|
properties: {
|
|
version: {
|
|
type: 'integer',
|
|
},
|
|
environments: {
|
|
type: 'array',
|
|
items: {
|
|
$ref: '#/components/schemas/environmentSchema',
|
|
},
|
|
},
|
|
},
|
|
components: {
|
|
schemas: {
|
|
environmentSchema,
|
|
},
|
|
},
|
|
} as const;
|
|
|
|
export type EnvironmentsSchema = FromSchema<typeof environmentsSchema>;
|