1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-17 13:46:47 +02:00
unleash.unleash/src/lib/openapi/spec/patch-schema.ts
Christopher Kolstad 53354224fc
chore: Bump biome and configure husky (#6589)
Upgrades biome to 1.6.1, and updates husky pre-commit hook.

Most changes here are making type imports explicit.
2024-03-18 13:58:05 +01:00

37 lines
1.1 KiB
TypeScript

import type { FromSchema } from 'json-schema-to-ts';
export const patchSchema = {
$id: '#/components/schemas/patchSchema',
type: 'object',
required: ['path', 'op'],
description:
'A [JSON patch](https://www.rfc-editor.org/rfc/rfc6902) operation description',
properties: {
path: {
type: 'string',
description: 'The path to the property to operate on',
example: '/type',
},
op: {
type: 'string',
enum: ['add', 'remove', 'replace', 'copy', 'move'],
description: 'The kind of operation to perform',
example: 'replace',
},
from: {
type: 'string',
description:
'The target to move or copy from, if performing one of those operations',
example: '/type',
},
value: {
description:
'The value to add or replace, if performing one of those operations',
example: 'kill-switch',
},
},
components: {},
} as const;
export type PatchSchema = FromSchema<typeof patchSchema>;