feat(openapi): Add OpenAPI module: decorators, spec generator, runtime validation and Swagger UI
This commit is contained in:
84
ts/openapi/index.ts
Normal file
84
ts/openapi/index.ts
Normal file
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* OpenAPI Module for SmartServe
|
||||
*
|
||||
* Provides:
|
||||
* - Decorators for API documentation and validation
|
||||
* - OpenAPI 3.1 specification generation
|
||||
* - Swagger UI / ReDoc handlers
|
||||
* - Request validation using JSON Schema
|
||||
*/
|
||||
|
||||
// Type exports
|
||||
export type {
|
||||
// OpenAPI Spec types
|
||||
IOpenApiSpec,
|
||||
IOpenApiInfo,
|
||||
IOpenApiContact,
|
||||
IOpenApiLicense,
|
||||
IOpenApiServer,
|
||||
IOpenApiServerVariable,
|
||||
IOpenApiPathItem,
|
||||
IOpenApiOperation,
|
||||
IOpenApiParameter,
|
||||
IOpenApiRequestBody,
|
||||
IOpenApiMediaType,
|
||||
IOpenApiResponse,
|
||||
IOpenApiExample,
|
||||
IOpenApiComponents,
|
||||
IOpenApiSecurityScheme,
|
||||
IOpenApiSecuritySchemeApiKey,
|
||||
IOpenApiSecuritySchemeHttp,
|
||||
IOpenApiSecuritySchemeOAuth2,
|
||||
IOpenApiSecuritySchemeOpenIdConnect,
|
||||
IOpenApiOAuthFlows,
|
||||
IOpenApiOAuthFlow,
|
||||
IOpenApiSecurityRequirement,
|
||||
IOpenApiTag,
|
||||
IOpenApiExternalDocs,
|
||||
// Options types
|
||||
IOpenApiGeneratorOptions,
|
||||
IOpenApiOptions,
|
||||
} from './openapi.types.js';
|
||||
|
||||
export type {
|
||||
IValidationError,
|
||||
IValidationResult,
|
||||
} from './openapi.validator.js';
|
||||
|
||||
// Decorators
|
||||
export {
|
||||
ApiOperation,
|
||||
ApiParam,
|
||||
ApiQuery,
|
||||
ApiHeader,
|
||||
ApiRequestBody,
|
||||
ApiResponseBody,
|
||||
ApiSecurity,
|
||||
ApiTag,
|
||||
} from './openapi.decorators.js';
|
||||
|
||||
// Generator
|
||||
export { OpenApiGenerator } from './openapi.generator.js';
|
||||
|
||||
// Handlers
|
||||
export {
|
||||
createOpenApiHandler,
|
||||
createSwaggerUiHandler,
|
||||
createReDocHandler,
|
||||
} from './openapi.handlers.js';
|
||||
|
||||
// Validation
|
||||
export {
|
||||
validateSchema,
|
||||
validateParam,
|
||||
validateRequest,
|
||||
createValidationInterceptor,
|
||||
createValidationErrorResponse,
|
||||
} from './openapi.validator.js';
|
||||
|
||||
// Coercion
|
||||
export {
|
||||
coerceValue,
|
||||
coerceQueryParams,
|
||||
coercePathParams,
|
||||
} from './openapi.coerce.js';
|
||||
Reference in New Issue
Block a user