MCPcopy Create free account
hub / github.com/middleapi/orpc / checkParamsSchema

Function checkParamsSchema

packages/openapi/src/openapi-utils.ts:143–156  ·  view source on GitHub ↗
(schema: ObjectSchema, params: string[])

Source from the content-addressed store, hash-verified

141 * @internal
142 */
143export function checkParamsSchema(schema: ObjectSchema, params: string[]): boolean {
144 const properties = Object.keys(schema.properties ?? {})
145 const required = schema.required ?? []
146
147 if (properties.length !== params.length || properties.some(v => !params.includes(v))) {
148 return false
149 }
150
151 if (required.length !== params.length || required.some(v => !params.includes(v))) {
152 return false
153 }
154
155 return true
156}
157
158/**
159 * @internal

Callers 2

#requestMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected