MCPcopy
hub / github.com/AndrewWalsh/openapi-devtools / getResBodyJSONTypes

Function getResBodyJSONTypes

src/lib/RequestStore.test.ts:30–42  ·  view source on GitHub ↗
(
  store: RequestStore,
  host: string,
  path: string,
  propName = testKey
)

Source from the content-addressed store, hash-verified

28const contentBoolTest = JSON.stringify(testBoolObj);
29
30const getResBodyJSONTypes = (
31 store: RequestStore,
32 host: string,
33 path: string,
34 propName = testKey
35) => {
36 const match = store.get()[host]?.lookup(path);
37 if (!match) throw new Error("Could not match path");
38 const properties =
39 match.data.methods[POST]?.response?.[200]?.["application/json"]?.body
40 ?.properties?.[propName]?.type || undefined;
41 return properties;
42};
43
44it("parameterises and merges paths", () => {
45 const store = new RequestStore();

Callers 1

Calls 1

getMethod · 0.80

Tested by

no test coverage detected