( schema: S, expected: object )
| 46 | } |
| 47 | |
| 48 | async function assertDraft201909<S extends Schema.Schema.All>( |
| 49 | schema: S, |
| 50 | expected: object |
| 51 | ) { |
| 52 | const definitions = {} |
| 53 | const jsonSchema = JSONSchema.fromAST(schema.ast, { |
| 54 | definitions, |
| 55 | target: "jsonSchema2019-09" |
| 56 | }) |
| 57 | deepStrictEqual(jsonSchema, expected) |
| 58 | const valid = ajv2020.validateSchema(jsonSchema) |
| 59 | if (valid instanceof Promise) { |
| 60 | await valid |
| 61 | } |
| 62 | strictEqual(ajv2020.errors, null) |
| 63 | return jsonSchema |
| 64 | } |
| 65 | |
| 66 | async function assertOpenApi3_1<S extends Schema.Schema.All>( |
| 67 | schema: S, |
no test coverage detected