(server)
| 393 | }) |
| 394 | |
| 395 | async function schemaPlugin (server) { |
| 396 | server.setSchemaController({ |
| 397 | bucket () { |
| 398 | t.assert.ok('the bucket is created') |
| 399 | return { |
| 400 | addSchema (source) { |
| 401 | ajvInstance.addSchema(source) |
| 402 | }, |
| 403 | getSchema (id) { |
| 404 | return ajvInstance.getSchema(id).schema |
| 405 | }, |
| 406 | getSchemas () { |
| 407 | return { |
| 408 | 'urn:schema:base': baseSchema, |
| 409 | 'urn:schema:ref': refSchema |
| 410 | } |
| 411 | } |
| 412 | } |
| 413 | } |
| 414 | }) |
| 415 | server.setValidatorCompiler(function ({ schema }) { |
| 416 | t.assert.ok('the querystring schema is compiled') |
| 417 | return ajvInstance.compile(schema) |
| 418 | }) |
| 419 | } |
| 420 | schemaPlugin[Symbol.for('skip-override')] = true |
| 421 | }) |
| 422 |
nothing calls this directly
no test coverage detected