MCPcopy Create free account
hub / github.com/EvilFreelancer/openapi-to-cli / parseSpec

Method parseSpec

src/openapi-loader.ts:79–87  ·  view source on GitHub ↗
(content: string | object, source: string)

Source from the content-addressed store, hash-verified

77 }
78
79 private parseSpec(content: string | object, source: string): unknown {
80 if (typeof content !== "string") {
81 return content;
82 }
83 if (this.isYamlSource(source) || !this.looksLikeJson(content)) {
84 return yaml.load(content);
85 }
86 return JSON.parse(content);
87 }
88
89 private async resolveRefs(
90 value: unknown,

Callers 1

loadFromSourceMethod · 0.95

Calls 3

isYamlSourceMethod · 0.95
looksLikeJsonMethod · 0.95
loadMethod · 0.80

Tested by

no test coverage detected