Home / Function/ setSerializerCompiler() — fastify Function Reference

setSerializerCompiler() — fastify Function Reference

Architecture documentation for the setSerializerCompiler() function in schema-controller.js from the fastify codebase.

Entity Profile

Dependency Diagram

graph TD
  fd251ae9_58ce_22a7_c9ee_7377175ded44["setSerializerCompiler()"]
  f9c71bed_770a_87b0_8d4c_3279f23ba910["SchemaController"]
  fd251ae9_58ce_22a7_c9ee_7377175ded44 -->|defined in| f9c71bed_770a_87b0_8d4c_3279f23ba910
  style fd251ae9_58ce_22a7_c9ee_7377175ded44 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

lib/schema-controller.js lines 97–117

  setSerializerCompiler (serializerCompiler) {
    // Set up as if the fixed serializer compiler had been provided
    // by a custom 'options.compilersFactory.buildSerializer' that
    // always returns the same compiler object. This is required because:
    //
    // - setSerializerCompiler must immediately install a compiler to preserve
    //   legacy behavior
    // - setupSerializer will recreate compilers from builders in some
    //   circumstances, so we have to install this adapter to make it
    //   behave the same if the legacy API is used
    //
    // The cloning of the compilersFactory object is necessary because
    // we are aliasing the parent compilersFactory if none was provided
    // to us (see constructor.)
    this.compilersFactory = Object.assign(
      {},
      this.compilersFactory,
      { buildSerializer: () => serializerCompiler })
    this.serializerCompiler = serializerCompiler
    this.isCustomSerializerCompiler = true
  }

Domain

Subdomains

Frequently Asked Questions

What does setSerializerCompiler() do?
setSerializerCompiler() is a function in the fastify codebase, defined in lib/schema-controller.js.
Where is setSerializerCompiler() defined?
setSerializerCompiler() is defined in lib/schema-controller.js at line 97.

Analyze Your Own Codebase

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

Try Supermodel Free