MCPcopy Index your code
hub / github.com/ReAPI-com/mcp-openapi / isValidSpecObject

Method isValidSpecObject

src/core/SpecScanner.ts:212–220  ·  view source on GitHub ↗

* Validates that the parsed object has the basic structure of an OpenAPI spec * @param spec - The parsed spec object * @returns true if the spec has the basic required structure

(spec: unknown)

Source from the content-addressed store, hash-verified

210 * @returns true if the spec has the basic required structure
211 */
212 private isValidSpecObject(spec: unknown): spec is OpenAPIV3.Document {
213 return (
214 typeof spec === "object" &&
215 spec !== null &&
216 "info" in spec &&
217 typeof spec.info === "object" &&
218 spec.info !== null
219 );
220 }
221
222 /**
223 * Extracts the spec ID from the spec object

Callers 1

processFileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected