Request Validation

Nolxy validates incoming request bodies against JSON Schema before they reach your backend. Define schemas per route and method — invalid requests are rejected at the gateway with structured error responses.

How It Works

Validation rules are attached to a route + HTTP method pair. When a request matches, Nolxy validates the JSON body against the configured schema before proxying to the backend.

Pre-proxy Validation

Invalid requests never reach your backend. Nolxy returns 400 Bad Request with detailed field-level errors.

JSON Schema Standard

Schemas follow the JSON Schema specification. Supports types, required fields, patterns, min/max, enums, nested objects, and arrays.

Visual Schema Builder

Build schemas visually in the dashboard with drag-and-drop field ordering — no JSON editing required.

Defining a Schema

Schemas are defined as JSON Schema objects. Here is an example for a POST /users endpoint:

JSON Schema
{
  "type": "object",
  "required": ["name", "email"],
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "age": {
      "type": "integer",
      "minimum": 0,
      "maximum": 150
    }
  },
  "additionalProperties": false
}

Error Responses

When validation fails, Nolxy returns a 400 response with structured error details:

400 Bad Request
{
  "status": "Error",
  "message": "Validation failed",
  "errors": [
    {
      "field": "email",
      "message": "must match format \"email\""
    },
    {
      "field": "name",
      "message": "is required"
    }
  ]
}

Supported Field Types

string
Text values. Supports minLength, maxLength, pattern, format (email, uri, date-time).
number
Floating-point numbers. Supports minimum, maximum, multipleOf.
integer
Whole numbers. Same constraints as number.
boolean
True/false values.
array
Lists of items. Supports minItems, maxItems, items schema.
object
Nested objects with their own properties and required fields.
enum
Restrict values to a predefined set of allowed options.

Plan Requirements

Request Validation is available on all plans. The maximum number of validation schemas per route is determined by your plan tier.