Home / Function/ preValidationCallback() — fastify Function Reference

preValidationCallback() — fastify Function Reference

Architecture documentation for the preValidationCallback() function in handle-request.js from the fastify codebase.

Entity Profile

Dependency Diagram

graph TD
  7572f912_c1b1_90a5_aa92_ccc1f36a0010["preValidationCallback()"]
  5f4e2742_950b_3da4_4ca3_7033016d7828["handle-request.js"]
  7572f912_c1b1_90a5_aa92_ccc1f36a0010 -->|defined in| 5f4e2742_950b_3da4_4ca3_7033016d7828
  060f474d_3ec6_ccf3_5b20_c7c0bafc7898["handler()"]
  060f474d_3ec6_ccf3_5b20_c7c0bafc7898 -->|calls| 7572f912_c1b1_90a5_aa92_ccc1f36a0010
  910429e3_db8b_fa1f_e3fe_171dde1614b6["validationCompleted()"]
  7572f912_c1b1_90a5_aa92_ccc1f36a0010 -->|calls| 910429e3_db8b_fa1f_e3fe_171dde1614b6
  style 7572f912_c1b1_90a5_aa92_ccc1f36a0010 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

lib/handle-request.js lines 85–103

function preValidationCallback (err, request, reply) {
  if (reply.sent === true) return

  if (err != null) {
    reply[kReplyIsError] = true
    reply.send(err)
    return
  }

  const validationErr = validateSchema(reply[kRouteContext], request)
  const isAsync = (validationErr && typeof validationErr.then === 'function') || false

  if (isAsync) {
    const cb = validationCompleted.bind(null, request, reply)
    validationErr.then(cb, cb)
  } else {
    validationCompleted(request, reply, validationErr)
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does preValidationCallback() do?
preValidationCallback() is a function in the fastify codebase, defined in lib/handle-request.js.
Where is preValidationCallback() defined?
preValidationCallback() is defined in lib/handle-request.js at line 85.
What does preValidationCallback() call?
preValidationCallback() calls 1 function(s): validationCompleted.
What calls preValidationCallback()?
preValidationCallback() is called by 1 function(s): handler.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free