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

Function schemaWithProperties

packages/server/test/swagger.e2e.test.ts:116–127  ·  view source on GitHub ↗
(schema: Record<string, unknown>)

Source from the content-addressed store, hash-verified

114}
115
116function schemaWithProperties(schema: Record<string, unknown>): Record<string, unknown> {
117 if (schema['properties'] !== undefined) return schema;
118 for (const key of ['anyOf', 'oneOf', 'allOf']) {
119 const variants = schema[key];
120 if (!Array.isArray(variants)) continue;
121 for (const variant of variants) {
122 const record = asRecord(variant);
123 if (record['properties'] !== undefined) return record;
124 }
125 }
126 throw new Error('expected schema with properties');
127}
128
129describe('Swagger / OpenAPI', () => {
130 it('/openapi.json returns a valid OpenAPI document', async () => {

Callers 1

Calls 1

asRecordFunction · 0.70

Tested by

no test coverage detected