(schema: Record<string, unknown>)
| 114 | } |
| 115 | |
| 116 | function 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 | |
| 129 | describe('Swagger / OpenAPI', () => { |
| 130 | it('/openapi.json returns a valid OpenAPI document', async () => { |
no test coverage detected