mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-24 01:18:01 +02:00
We don't provide many patch endpoints, so we _could_ create separate patch operation objects for each one. I think that makes sense to do as part of the larger cleanup. For now, I think it's worth to simply turn it into one of these. While it's not entirely accurate, it's better than what we had before.
31 lines
715 B
TypeScript
31 lines
715 B
TypeScript
import { FromSchema } from 'json-schema-to-ts';
|
|
|
|
export const patchSchema = {
|
|
$id: '#/components/schemas/patchSchema',
|
|
type: 'object',
|
|
required: ['path', 'op'],
|
|
properties: {
|
|
path: {
|
|
type: 'string',
|
|
},
|
|
op: {
|
|
type: 'string',
|
|
enum: ['add', 'remove', 'replace', 'copy', 'move'],
|
|
},
|
|
from: {
|
|
type: 'string',
|
|
},
|
|
value: {
|
|
oneOf: [
|
|
{
|
|
type: 'object',
|
|
},
|
|
{ type: 'array', items: { type: 'object' } },
|
|
],
|
|
},
|
|
},
|
|
components: {},
|
|
} as const;
|
|
|
|
export type PatchSchema = FromSchema<typeof patchSchema>;
|