MCPcopy
hub / github.com/Effect-TS/effect / assertDraft201909

Function assertDraft201909

packages/effect/test/Schema/JSONSchema.new.test.ts:48–64  ·  view source on GitHub ↗
(
  schema: S,
  expected: object
)

Source from the content-addressed store, hash-verified

46}
47
48async 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
66async function assertOpenApi3_1<S extends Schema.Schema.All>(
67 schema: S,

Callers 1

Calls 2

deepStrictEqualFunction · 0.90
strictEqualFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…