MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / responseJsonSchema

Function responseJsonSchema

packages/server/test/swagger.e2e.test.ts:103–114  ·  view source on GitHub ↗
(
  doc: Record<string, unknown>,
  path: string,
  method: string,
  status = '200',
)

Source from the content-addressed store, hash-verified

101}
102
103function responseJsonSchema(
104 doc: Record<string, unknown>,
105 path: string,
106 method: string,
107 status = '200',
108): Record<string, unknown> {
109 const responses = asRecord(operation(doc, path, method)['responses']);
110 const response = asRecord(responses[status]);
111 const content = asRecord(response['content']);
112 const json = asRecord(content['application/json']);
113 return asRecord(json['schema']);
114}
115
116function schemaWithProperties(schema: Record<string, unknown>): Record<string, unknown> {
117 if (schema['properties'] !== undefined) return schema;

Callers 1

Calls 2

operationFunction · 0.85
asRecordFunction · 0.70

Tested by

no test coverage detected