( doc: Record<string, unknown>, path: string, method: string, status = '200', )
| 101 | } |
| 102 | |
| 103 | function 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 | |
| 116 | function schemaWithProperties(schema: Record<string, unknown>): Record<string, unknown> { |
| 117 | if (schema['properties'] !== undefined) return schema; |
no test coverage detected