ObjectStackObjectStack

Http Server

Http Server protocol schemas

HTTP Server Protocol

Route-registration metadata, middleware declaration and the server-side lifecycle/status vocabulary for HTTP server implementations (Express, Fastify, Hono, etc.)

Architecture alignment:

  • Kubernetes: Service and Ingress resources
  • AWS: API Gateway configuration
  • Spring Boot: Application properties

Source: packages/spec/src/system/http-server.zod.ts

TypeScript Usage

import { MiddlewareConfigSchema, MiddlewareType, RouteHandlerMetadataSchema } from '@objectstack/spec/system';
import type { MiddlewareConfig, MiddlewareType, RouteHandlerMetadata } from '@objectstack/spec/system';

// Validate data
const result = MiddlewareConfigSchema.parse(data);

MiddlewareConfig

Properties

PropertyTypeRequiredDescription
namestringMiddleware name (snake_case)
typeEnum<'authentication' | 'authorization' | 'logging' | 'validation' | 'transformation' | 'error' | 'custom'>Middleware type
enabledbooleanWhether middleware is enabled
orderintegerExecution order priority
configRecord<string, any>optionalMiddleware configuration object
paths{ include?: string[]; exclude?: string[] }optionalPath filtering

MiddlewareType

Allowed Values

  • authentication
  • authorization
  • logging
  • validation
  • transformation
  • error
  • custom

RouteHandlerMetadata

Properties

PropertyTypeRequiredDescription
methodEnum<'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS'>HTTP method
pathstringURL path pattern
handlerstringHandler identifier or name
metadata{ summary?: string; description?: string; tags?: string[]; operationId?: string }optional
security{ authRequired: boolean; permissions?: string[]; rateLimit?: string }optional

On this page