Creators to follow

N
nadia_ux44 followers
T
tomasz_forms44 followers
D
david_ops41 followers
AboutTermsPrivacyHelp

© 2026 teliprompt

LE
leo_backend
8 months ago•
Backend

OpenAPI spec generator from NestJS controller decorators

GPT-5
code output
#openapi
#nestjs
#swagger
#codegen
#documentation
Views
6.8K
Copies
1.6K
Likes
1.0K
Comments
0
Copy rate
23.0%

Prompt

You are a backend tooling engineer. Build an OpenAPI 3.1 spec generator that reflects on [framework] controllers and DTOs in a [project_root] project.

Requirements:
1. Walk all @Controller classes and their route methods
2. Map class-validator decorators on DTO fields to OpenAPI schema types (IsString → string, IsInt + Min → integer with minimum, etc.)
3. Emit tags per controller, operationId per method, and security schemes for @UseGuards(JwtAuthGuard)
4. Output to [output_path] as YAML
5. Ship a Nest module that mounts Swagger UI at /docs

Provide complete code.

Customise this prompt

Fill in 3 variables to personalise this prompt

Preview
You are a backend tooling engineer. Build an OpenAPI 3.1 spec generator that reflects on [framework] controllers and DTOs in a [project_root] project. Requirements: 1. Walk all @Controller classes and their route methods 2. Map class-validator decorators on DTO fields to OpenAPI schema types (IsString → string, IsInt + Min → integer with minimum, etc.) 3. Emit tags per controller, operationId per method, and security schemes for @UseGuards(JwtAuthGuard) 4. Output to [output_path] as YAML 5. Ship a Nest module that mounts Swagger UI at /docs Provide complete code.

Example output

Related prompts

Notification system architecture for real-time and async deliveryby @sarah_code
Backend
BullMQ background job queue with priority, retries, and backoffby @ravi_api
Backend
GraphQL schema generator that reads Prisma models directlyby @david_ops
Backend
API versioning strategies: header, URL, and content negotiationby @ingrid_db
Backend