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

Function assertOpenApi3_1

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

Source from the content-addressed store, hash-verified

64}
65
66async function assertOpenApi3_1<S extends Schema.Schema.All>(
67 schema: S,
68 expected: object
69) {
70 const definitions = {}
71 const jsonSchema = JSONSchema.fromAST(schema.ast, {
72 definitions,
73 target: "openApi3.1"
74 })
75 deepStrictEqual(jsonSchema, expected)
76 const valid = ajv2020.validateSchema(jsonSchema)
77 if (valid instanceof Promise) {
78 await valid
79 }
80 strictEqual(ajvDraft7.errors, null)
81 return jsonSchema
82}
83
84async function assertDraft2020_12<S extends Schema.Schema.All>(
85 schema: S,

Callers 1

Calls 2

deepStrictEqualFunction · 0.90
strictEqualFunction · 0.90

Tested by

no test coverage detected