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

Function isPrimitiveSchema

packages/openapi/src/schema-utils.ts:238–254  ·  view source on GitHub ↗
(schema: JSONSchema)

Source from the content-addressed store, hash-verified

236])
237
238export function isPrimitiveSchema(schema: JSONSchema): boolean {
239 return expandUnionSchema(schema).every((s) => {
240 if (typeof s === 'boolean') {
241 return false
242 }
243
244 if (typeof s.type === 'string' && PRIMITIVE_SCHEMA_TYPES.has(s.type)) {
245 return true
246 }
247
248 if (s.const !== undefined) {
249 return true
250 }
251
252 return false
253 })
254}

Callers 2

toOpenAPIParametersFunction · 0.90

Calls 1

expandUnionSchemaFunction · 0.85

Tested by

no test coverage detected