Home / File/ reply-serialize.test.js — fastify Source File

reply-serialize.test.js — fastify Source File

Architecture documentation for reply-serialize.test.js, a javascript file in the fastify codebase.

Entity Profile

Relationship Graph

Source Code

'use strict'

const { test } = require('node:test')
const { kReplyCacheSerializeFns, kRouteContext } = require('../../lib/symbols')
const Fastify = require('../../fastify')

function getDefaultSchema () {
  return {
    type: 'object',
    required: ['hello'],
    properties: {
      hello: { type: 'string' },
      world: { type: 'string' }
    }
  }
}

function getResponseSchema () {
  return {
    201: {
      type: 'object',
      required: ['status'],
      properties: {
        status: {
          type: 'string',
          enum: ['ok']
        },
        message: {
          type: 'string'
        }
      }
    },
    '4xx': {
      type: 'object',
      properties: {
        status: {
          type: 'string',
          enum: ['error']
        },
        code: {
          type: 'integer',
          minimum: 1
        },
        message: {
          type: 'string'
        }
      }
    },
    '3xx': {
      content: {
        'application/json': {
          schema: {
            type: 'object',
            properties: {
              fullName: { type: 'string' },
              phone: { type: 'number' }
            }
          }
        }
      }
// ... (655 more lines)

Domain

Subdomains

Frequently Asked Questions

What does reply-serialize.test.js do?
reply-serialize.test.js is a source file in the fastify codebase, written in javascript. It belongs to the CoreKernel domain, LifecycleManager subdomain.
What functions are defined in reply-serialize.test.js?
reply-serialize.test.js defines 2 function(s): getDefaultSchema, getResponseSchema.
Where is reply-serialize.test.js in the architecture?
reply-serialize.test.js is located at test/internals/reply-serialize.test.js (domain: CoreKernel, subdomain: LifecycleManager, directory: test/internals).

Analyze Your Own Codebase

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

Try Supermodel Free