| 82 | const patchFailure = (detail: string) => new PatchApplicationFailure({ detail }); |
| 83 | |
| 84 | const isJsonValue = (value: unknown): value is JsonValue => { |
| 85 | if (value === null) return true; |
| 86 | if (typeof value === "string" || typeof value === "boolean") return true; |
| 87 | if (typeof value === "number") return Number.isFinite(value); |
| 88 | if (Array.isArray(value)) return value.every(isJsonValue); |
| 89 | if (typeof value !== "object") return false; |
| 90 | const prototype = Object.getPrototypeOf(value); |
| 91 | if (prototype !== Object.prototype && prototype !== null) return false; |
| 92 | return Object.values(value).every(isJsonValue); |
| 93 | }; |
| 94 | |
| 95 | const overrideError = (operationIndex: number, operation: string, path: string, detail: string) => |
| 96 | new OpenApiSpecOverrideError({ |