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
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | Middleware name (snake_case) |
| type | Enum<'authentication' | 'authorization' | 'logging' | 'validation' | 'transformation' | 'error' | 'custom'> | ✅ | Middleware type |
| enabled | boolean | ✅ | Whether middleware is enabled |
| order | integer | ✅ | Execution order priority |
| config | Record<string, any> | optional | Middleware configuration object |
| paths | { include?: string[]; exclude?: string[] } | optional | Path filtering |
MiddlewareType
Allowed Values
authenticationauthorizationloggingvalidationtransformationerrorcustom
RouteHandlerMetadata
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| method | Enum<'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS'> | ✅ | HTTP method |
| path | string | ✅ | URL path pattern |
| handler | string | ✅ | Handler identifier or name |
| metadata | { summary?: string; description?: string; tags?: string[]; operationId?: string } | optional | |
| security | { authRequired: boolean; permissions?: string[]; rateLimit?: string } | optional |