UNPKG

@tsed/schema

Version:
24 lines (23 loc) 701 B
import { cleanObject } from "@tsed/core"; import { registerJsonSchemaMapper } from "../../registries/JsonSchemaMapperContainer.js"; export function operationInFilesMapper(parameter, { jsonSchema }) { const schema = { type: "string", format: "binary", oneOf: undefined }; if (jsonSchema.type === "array") { jsonSchema.items = cleanObject({ ...jsonSchema.items, ...schema }); parameter.schema = jsonSchema; return parameter; } parameter.schema = cleanObject({ ...jsonSchema, ...schema }); return parameter; } registerJsonSchemaMapper("operationInFiles", operationInFilesMapper);