Novel
Get NovelGuidesAPI Reference
Latest - 2025.1.0
Latest - 2025.1.0
  • Welcome to Novel
  • Start
  • Philosophy
  • Tech Stack
  • Releases
  • Versions
  • Changelog
  • License
  • Privacy
  • Warranty
  • Security Policy
  • Errors
    • Cannot start Novel
    • Unauthorized
    • Invalid Session
    • Validation Failed
  • Novel Server
    • Getting Started
    • Project Structure
    • With Novel Web
    • Configuration
    • Novel CLI
      • novel dev
      • novel start
      • novel new
    • Novel API
      • API Reference
    • Database
      • Caching
    • Migrations
    • Models
    • Routing
      • Route Directives
      • Middleware
      • Request Helpers
      • Schema
    • Sessions
    • Authentication
      • Passwords
      • Magic Links
      • Two-Factor Authentication
      • Forget Password
      • Email Verification
      • OAuth2 Support
    • Authorization
    • Users
    • Organizations
    • Subscriptions
    • Pricing
    • Validation
    • Mail
    • Notifications
    • API Keys
    • Events
    • Errors
    • Feature Flags
    • Uploading Files
    • Testing
    • Scheduled Cron Jobs
    • Background Jobs
    • Sockets
    • Logging
    • Telemetry
    • Deployment
  • Novel Web
    • Getting Started
    • Configuration
    • Project Structure
    • Routing
    • Layout and Styles
    • Authentication
    • Authorization
    • Requests
    • Request Files
    • Validation
    • Components
      • Button
      • Alerts
      • Copybox
      • Inline Notify
      • Input
      • Select
      • Toast
      • Toggle
      • Upload
      • Stripe Card
    • Hooks
      • useSession
      • useMobile
      • getSession
      • useFeature
      • useAuthorized
      • useNotification
      • useSocket
    • Localstorage
    • Errors
    • Internationalization (i18n)
    • Constants
    • Feature Flags
    • Testing
    • Telemetry
    • Deployment
    • Devtools (Alpha)
Powered by GitBook
On this page
  • API Specs and Database
  • Changelog

Was this helpful?

  1. Novel Server

Validation

Last updated 5 months ago

Was this helpful?

Novel makes use of 2 validation mechanisms: JSON Schema and Zod. both serve specific purpose, for shaping requests and responses and for verifying input.

Although these are optional, it is recommended that you build your system utilizing these tools as much as possible.

API Specs and Database

JSON Schema, used within fastify via AJV, makes it easy to enforce how your api should behave before, during, and after processing.

This, along with the fast performance brought by fastify, makes your system more resilient when dealing with APIs.

You can see the libraries below

The standards above makes it easier to generate clients via OpenAPI/Swagger. These definitions are generated and used internally by the Novel Web client to easily expose routes as an RPC and provide an easy development experience.

JSON Schema is recommended to be used for API Request/Response shapes. Client-side validation should use zod instead.

For client-side validation. refer to Validation.

Changelog

  • 2024-12-20 - Initial Documentation

Using Validations →
Securing an Endpoint →
Ajv JSON schema validator
Logo
JSON SchemaJSON Schema
Logo