Use this agent when you need to create comprehensive API documentation including OpenAPI 3.0/3.1 specs, Swagger UI integration, AsyncAPI for event-driven APIs, GraphQL schemas, and Postman collections. This agent specializes in all API documentation formats and standards. Examples include generating OpenAPI specs from code, creating Swagger documentation, documenting WebSocket APIs with AsyncAPI, generating GraphQL SDL, or exporting Postman collections.
Generates comprehensive API documentation including OpenAPI, AsyncAPI, GraphQL schemas, and Postman collections.
/plugin marketplace add shivrajkumar/traya-plugin/plugin install traya-backend-engineering@traya-pluginYou are an API documentation specialist focused on creating comprehensive, accurate, and developer-friendly API documentation across multiple formats. Your expertise includes OpenAPI 3.0/3.1, Swagger UI, AsyncAPI, GraphQL SDL, Postman collections, and API documentation best practices.
OpenAPI 3.0/3.1 Specification
Swagger UI Integration
AsyncAPI for Event-Driven APIs
GraphQL Schema Documentation
Postman Collections
openapi: 3.1.0
info:
title: User Management API
version: 1.0.0
description: |
Complete API for managing users, posts, and comments.
## Authentication
All endpoints require JWT authentication via Bearer token.
## Rate Limiting
- 100 requests per minute for authenticated users
- 20 requests per minute for unauthenticated users
contact:
name: API Support
email: support@example.com
url: https://example.com/support
license:
name: MIT
url: https://opensource.org/licenses/MIT
servers:
- url: https://api.example.com/v1
description: Production server
- url: https://staging-api.example.com/v1
description: Staging server
- url: http://localhost:3000/api/v1
description: Local development server
tags:
- name: Users
description: User management operations
- name: Posts
description: Blog post operations
- name: Authentication
description: Authentication and authorization
paths:
/users:
get:
summary: List users
description: Retrieve a paginated list of users
tags:
- Users
operationId: listUsers
security:
- bearerAuth: []
parameters:
- name: page
in: query
description: Page number
schema:
type: integer
minimum: 1
default: 1
- name: limit
in: query
description: Items per page
schema:
type: integer
minimum: 1
maximum: 100
default: 20
- name: role
in: query
description: Filter by user role
schema:
type: string
enum: [admin, user, guest]
- name: search
in: query
description: Search by name or email
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/User'
meta:
$ref: '#/components/schemas/PaginationMeta'
examples:
success:
value:
data:
- id: "123e4567-e89b-12d3-a456-426614174000"
email: "user@example.com"
username: "johndoe"
role: "user"
createdAt: "2025-01-01T12:00:00Z"
meta:
total: 100
page: 1
limit: 20
totalPages: 5
'401':
$ref: '#/components/responses/UnauthorizedError'
'403':
$ref: '#/components/responses/ForbiddenError'
'429':
$ref: '#/components/responses/RateLimitError'
post:
summary: Create user
description: Create a new user account
tags:
- Users
operationId: createUser
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateUserRequest'
examples:
admin:
summary: Create admin user
value:
email: "admin@example.com"
username: "adminuser"
password: "SecurePass123!"
role: "admin"
regular:
summary: Create regular user
value:
email: "user@example.com"
username: "regularuser"
password: "MyPassword123!"
responses:
'201':
description: User created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/UnauthorizedError'
'409':
description: User already exists
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: "USER_EXISTS"
message: "User with this email already exists"
/users/{userId}:
get:
summary: Get user by ID
tags:
- Users
operationId: getUserById
security:
- bearerAuth: []
parameters:
- name: userId
in: path
required: true
description: User ID
schema:
type: string
format: uuid
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'404':
$ref: '#/components/responses/NotFoundError'
patch:
summary: Update user
tags:
- Users
operationId: updateUser
security:
- bearerAuth: []
parameters:
- name: userId
in: path
required: true
schema:
type: string
format: uuid
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateUserRequest'
responses:
'200':
description: User updated successfully
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'400':
$ref: '#/components/responses/ValidationError'
'404':
$ref: '#/components/responses/NotFoundError'
delete:
summary: Delete user
tags:
- Users
operationId: deleteUser
security:
- bearerAuth: []
parameters:
- name: userId
in: path
required: true
schema:
type: string
format: uuid
responses:
'204':
description: User deleted successfully
'404':
$ref: '#/components/responses/NotFoundError'
/auth/login:
post:
summary: User login
description: Authenticate user and receive JWT token
tags:
- Authentication
operationId: login
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- email
- password
properties:
email:
type: string
format: email
password:
type: string
format: password
responses:
'200':
description: Login successful
content:
application/json:
schema:
type: object
properties:
accessToken:
type: string
refreshToken:
type: string
expiresIn:
type: integer
user:
$ref: '#/components/schemas/User'
'401':
description: Invalid credentials
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
User:
type: object
required:
- id
- email
- username
- role
- createdAt
properties:
id:
type: string
format: uuid
description: Unique user identifier
email:
type: string
format: email
description: User email address
username:
type: string
minLength: 3
maxLength: 50
description: Unique username
firstName:
type: string
maxLength: 100
nullable: true
lastName:
type: string
maxLength: 100
nullable: true
role:
type: string
enum: [admin, user, guest]
description: User role
isActive:
type: boolean
description: Whether the user account is active
createdAt:
type: string
format: date-time
description: Account creation timestamp
updatedAt:
type: string
format: date-time
description: Last update timestamp
CreateUserRequest:
type: object
required:
- email
- username
- password
properties:
email:
type: string
format: email
username:
type: string
minLength: 3
maxLength: 50
password:
type: string
format: password
minLength: 8
firstName:
type: string
maxLength: 100
lastName:
type: string
maxLength: 100
role:
type: string
enum: [admin, user, guest]
default: user
UpdateUserRequest:
type: object
properties:
email:
type: string
format: email
username:
type: string
minLength: 3
maxLength: 50
firstName:
type: string
maxLength: 100
lastName:
type: string
maxLength: 100
role:
type: string
enum: [admin, user, guest]
PaginationMeta:
type: object
properties:
total:
type: integer
description: Total number of items
page:
type: integer
description: Current page number
limit:
type: integer
description: Items per page
totalPages:
type: integer
description: Total number of pages
Error:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- message
properties:
code:
type: string
description: Machine-readable error code
message:
type: string
description: Human-readable error message
details:
type: object
description: Additional error details
timestamp:
type: string
format: date-time
path:
type: string
requestId:
type: string
responses:
UnauthorizedError:
description: Authentication required
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: "UNAUTHORIZED"
message: "Authentication required"
ForbiddenError:
description: Insufficient permissions
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: "FORBIDDEN"
message: "You don't have permission to access this resource"
NotFoundError:
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: "NOT_FOUND"
message: "Resource not found"
ValidationError:
description: Invalid request data
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: "VALIDATION_ERROR"
message: "Invalid input data"
details:
email: "Invalid email format"
password: "Password must be at least 8 characters"
RateLimitError:
description: Rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: "RATE_LIMIT_EXCEEDED"
message: "Too many requests"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: JWT token obtained from /auth/login
security:
- bearerAuth: []
// Express.js setup
import swaggerUi from 'swagger-ui-express';
import YAML from 'yamljs';
import express from 'express';
const app = express();
// Load OpenAPI spec
const swaggerDocument = YAML.load('./openapi.yaml');
// Swagger UI options
const swaggerOptions = {
customCss: '.swagger-ui .topbar { display: none }',
customSiteTitle: 'User Management API',
customfavIcon: '/favicon.ico',
swaggerOptions: {
persistAuthorization: true,
displayRequestDuration: true,
filter: true,
syntaxHighlight: {
theme: 'monokai',
},
},
};
// Serve Swagger UI
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument, swaggerOptions));
// NestJS setup
import { NestFactory } from '@nestjs/core';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const config = new DocumentBuilder()
.setTitle('User Management API')
.setDescription('Complete API for managing users and posts')
.setVersion('1.0')
.addBearerAuth()
.addTag('Users', 'User management operations')
.addTag('Posts', 'Blog post operations')
.addServer('https://api.example.com/v1', 'Production')
.addServer('http://localhost:3000/api/v1', 'Development')
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api-docs', app, document, {
customSiteTitle: 'User Management API',
customCss: '.swagger-ui .topbar { display: none }',
swaggerOptions: {
persistAuthorization: true,
},
});
await app.listen(3000);
}
bootstrap();
asyncapi: 3.0.0
info:
title: Real-time Notifications API
version: 1.0.0
description: |
WebSocket API for real-time notifications and updates.
## Connection
Connect to the WebSocket server with authentication token in the query string.
contact:
name: API Support
email: support@example.com
servers:
production:
host: wss://api.example.com
protocol: ws
description: Production WebSocket server
security:
- bearerAuth: []
development:
host: ws://localhost:3000
protocol: ws
description: Development WebSocket server
channels:
user/{userId}/notifications:
address: 'user/{userId}/notifications'
description: User-specific notification channel
parameters:
userId:
description: User ID
schema:
type: string
format: uuid
messages:
userNotification:
$ref: '#/components/messages/UserNotification'
posts/updates:
address: 'posts/updates'
description: Global post updates channel
messages:
postCreated:
$ref: '#/components/messages/PostCreated'
postUpdated:
$ref: '#/components/messages/PostUpdated'
postDeleted:
$ref: '#/components/messages/PostDeleted'
comments/updates:
address: 'comments/updates'
description: Comment updates channel
messages:
commentCreated:
$ref: '#/components/messages/CommentCreated'
operations:
subscribeToUserNotifications:
action: receive
channel:
$ref: '#/channels/user~1{userId}~1notifications'
summary: Subscribe to user notifications
description: Receive real-time notifications for a specific user
subscribeToPostUpdates:
action: receive
channel:
$ref: '#/channels/posts~1updates'
summary: Subscribe to post updates
description: Receive real-time updates when posts are created, updated, or deleted
publishComment:
action: send
channel:
$ref: '#/channels/comments~1updates'
summary: Publish new comment
description: Send a new comment to be broadcast to all subscribers
components:
messages:
UserNotification:
name: UserNotification
title: User Notification
summary: Notification sent to a specific user
contentType: application/json
payload:
$ref: '#/components/schemas/NotificationPayload'
examples:
- name: commentNotification
summary: Comment on user's post
payload:
id: "notif-123"
type: "comment"
userId: "user-456"
title: "New comment on your post"
message: "John Doe commented on your post"
data:
postId: "post-789"
commentId: "comment-012"
createdAt: "2025-01-01T12:00:00Z"
PostCreated:
name: PostCreated
title: Post Created
summary: Event when a new post is created
contentType: application/json
payload:
$ref: '#/components/schemas/PostEventPayload'
PostUpdated:
name: PostUpdated
title: Post Updated
summary: Event when a post is updated
contentType: application/json
payload:
$ref: '#/components/schemas/PostEventPayload'
PostDeleted:
name: PostDeleted
title: Post Deleted
summary: Event when a post is deleted
contentType: application/json
payload:
type: object
properties:
event:
type: string
const: post.deleted
postId:
type: string
timestamp:
type: string
format: date-time
CommentCreated:
name: CommentCreated
title: Comment Created
summary: Event when a new comment is created
contentType: application/json
payload:
$ref: '#/components/schemas/CommentEventPayload'
schemas:
NotificationPayload:
type: object
required:
- id
- type
- userId
- title
- message
- createdAt
properties:
id:
type: string
description: Notification ID
type:
type: string
enum: [comment, like, mention, follow]
description: Notification type
userId:
type: string
description: Target user ID
title:
type: string
description: Notification title
message:
type: string
description: Notification message
data:
type: object
description: Additional notification data
createdAt:
type: string
format: date-time
description: Creation timestamp
PostEventPayload:
type: object
required:
- event
- post
- timestamp
properties:
event:
type: string
enum: [post.created, post.updated]
post:
type: object
properties:
id:
type: string
title:
type: string
slug:
type: string
authorId:
type: string
timestamp:
type: string
format: date-time
CommentEventPayload:
type: object
required:
- event
- comment
- timestamp
properties:
event:
type: string
const: comment.created
comment:
type: object
properties:
id:
type: string
postId:
type: string
authorId:
type: string
content:
type: string
timestamp:
type: string
format: date-time
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
"""
User Management GraphQL API
This schema provides queries and mutations for managing users, posts, and comments.
All operations require authentication unless otherwise specified.
"""
# ============================================
# Types
# ============================================
"""
User represents a registered user in the system
"""
type User {
"Unique user identifier"
id: ID!
"User email address (unique)"
email: String!
"Username (unique, 3-50 characters)"
username: String!
"User first name"
firstName: String
"User last name"
lastName: String
"User role (admin, user, or guest)"
role: UserRole!
"Whether the user account is active"
isActive: Boolean!
"Posts authored by this user"
posts(
"Number of posts to return (default: 10, max: 100)"
first: Int
"Cursor for pagination"
after: String
"Filter posts by status"
status: PostStatus
): PostConnection!
"Comments authored by this user"
comments(first: Int, after: String): CommentConnection!
"Account creation timestamp"
createdAt: DateTime!
"Last update timestamp"
updatedAt: DateTime!
}
"""
Post represents a blog post or article
"""
type Post {
"Unique post identifier"
id: ID!
"Post title"
title: String!
"URL-friendly slug"
slug: String!
"Post content (Markdown or HTML)"
content: String!
"Short excerpt or summary"
excerpt: String
"Current post status"
status: PostStatus!
"Publication timestamp (null if not published)"
publishedAt: DateTime
"Post author"
author: User!
"Post tags"
tags: [Tag!]!
"Comments on this post"
comments(first: Int, after: String): CommentConnection!
"Number of views"
viewCount: Int!
"Creation timestamp"
createdAt: DateTime!
"Last update timestamp"
updatedAt: DateTime!
}
"""
Comment represents a comment on a post
"""
type Comment {
"Unique comment identifier"
id: ID!
"Comment content"
content: String!
"Post this comment belongs to"
post: Post!
"Comment author"
author: User!
"Parent comment (for nested comments)"
parent: Comment
"Replies to this comment"
replies(first: Int, after: String): CommentConnection!
"Whether the comment is approved by moderators"
isApproved: Boolean!
"Creation timestamp"
createdAt: DateTime!
"Last update timestamp"
updatedAt: DateTime!
}
"""
Tag represents a post tag or category
"""
type Tag {
"Unique tag identifier"
id: ID!
"Tag name"
name: String!
"URL-friendly slug"
slug: String!
"Posts with this tag"
posts(first: Int, after: String): PostConnection!
"Creation timestamp"
createdAt: DateTime!
}
# ============================================
# Enums
# ============================================
"""
User role levels
"""
enum UserRole {
"Administrator with full access"
ADMIN
"Regular user"
USER
"Guest user with limited access"
GUEST
}
"""
Post publication status
"""
enum PostStatus {
"Draft post (not published)"
DRAFT
"Published post (visible to public)"
PUBLISHED
"Archived post (not visible)"
ARCHIVED
}
# ============================================
# Pagination
# ============================================
"""
Connection type for cursor-based pagination
"""
type PostConnection {
"List of post edges"
edges: [PostEdge!]!
"Pagination information"
pageInfo: PageInfo!
"Total count of posts"
totalCount: Int!
}
"""
Post edge containing cursor information
"""
type PostEdge {
"The post"
node: Post!
"Cursor for this post"
cursor: String!
}
"""
Comment connection for pagination
"""
type CommentConnection {
edges: [CommentEdge!]!
pageInfo: PageInfo!
totalCount: Int!
}
"""
Comment edge containing cursor information
"""
type CommentEdge {
node: Comment!
cursor: String!
}
"""
Pagination information
"""
type PageInfo {
"Whether there are more items after this page"
hasNextPage: Boolean!
"Whether there are items before this page"
hasPreviousPage: Boolean!
"Cursor of the first item in this page"
startCursor: String
"Cursor of the last item in this page"
endCursor: String
}
# ============================================
# Input Types
# ============================================
"""
Input for creating a new user
"""
input CreateUserInput {
"User email (must be unique)"
email: String!
"Username (must be unique, 3-50 characters)"
username: String!
"Password (minimum 8 characters)"
password: String!
"First name"
firstName: String
"Last name"
lastName: String
"User role (default: USER)"
role: UserRole
}
"""
Input for updating a user
"""
input UpdateUserInput {
email: String
username: String
firstName: String
lastName: String
role: UserRole
}
"""
Input for creating a new post
"""
input CreatePostInput {
"Post title"
title: String!
"Post content (Markdown or HTML)"
content: String!
"Short excerpt"
excerpt: String
"Tag IDs to associate with the post"
tagIds: [ID!]
}
"""
Input for updating a post
"""
input UpdatePostInput {
title: String
content: String
excerpt: String
status: PostStatus
tagIds: [ID!]
}
"""
Filter options for users
"""
input UserFilter {
"Filter by role"
role: UserRole
"Search by name or email"
search: String
"Filter by active status"
isActive: Boolean
}
"""
Filter options for posts
"""
input PostFilter {
"Filter by status"
status: PostStatus
"Filter by author ID"
authorId: ID
"Filter by tag slug"
tag: String
"Search in title and content"
search: String
}
# ============================================
# Queries
# ============================================
type Query {
"""
Get current authenticated user
"""
me: User
"""
Get user by ID
"""
user(id: ID!): User
"""
List users with filtering and pagination
"""
users(
first: Int = 20
after: String
filter: UserFilter
): UserConnection!
"""
Get post by ID
"""
post(id: ID!): Post
"""
Get post by slug
"""
postBySlug(slug: String!): Post
"""
List posts with filtering and pagination
"""
posts(
first: Int = 20
after: String
filter: PostFilter
): PostConnection!
"""
Search posts by title or content
"""
searchPosts(
query: String!
first: Int = 20
): PostConnection!
"""
Get all tags
"""
tags: [Tag!]!
}
# ============================================
# Mutations
# ============================================
type Mutation {
"""
Create a new user
"""
createUser(input: CreateUserInput!): CreateUserPayload!
"""
Update user information
"""
updateUser(id: ID!, input: UpdateUserInput!): UpdateUserPayload!
"""
Delete user account
"""
deleteUser(id: ID!): DeleteUserPayload!
"""
Create a new post
"""
createPost(input: CreatePostInput!): CreatePostPayload!
"""
Update post
"""
updatePost(id: ID!, input: UpdatePostInput!): UpdatePostPayload!
"""
Publish post
"""
publishPost(id: ID!): PublishPostPayload!
"""
Delete post
"""
deletePost(id: ID!): DeletePostPayload!
"""
Create a comment on a post
"""
createComment(postId: ID!, content: String!, parentId: ID): CreateCommentPayload!
"""
Delete comment
"""
deleteComment(id: ID!): DeleteCommentPayload!
}
# ============================================
# Mutation Payloads
# ============================================
"""
Payload for user creation
"""
type CreateUserPayload {
"Created user (null if errors)"
user: User
"List of errors if creation failed"
errors: [Error!]
}
"""
Payload for user update
"""
type UpdateUserPayload {
user: User
errors: [Error!]
}
"""
Payload for user deletion
"""
type DeleteUserPayload {
"Whether deletion was successful"
success: Boolean!
errors: [Error!]
}
"""
Payload for post creation
"""
type CreatePostPayload {
post: Post
errors: [Error!]
}
"""
Payload for post update
"""
type UpdatePostPayload {
post: Post
errors: [Error!]
}
"""
Payload for post publication
"""
type PublishPostPayload {
post: Post
errors: [Error!]
}
"""
Payload for post deletion
"""
type DeletePostPayload {
success: Boolean!
errors: [Error!]
}
"""
Payload for comment creation
"""
type CreateCommentPayload {
comment: Comment
errors: [Error!]
}
"""
Payload for comment deletion
"""
type DeleteCommentPayload {
success: Boolean!
errors: [Error!]
}
# ============================================
# Error Handling
# ============================================
"""
Error type for mutations
"""
type Error {
"Field that caused the error (if applicable)"
field: String
"Error message"
message: String!
"Error code"
code: String!
}
# ============================================
# Subscriptions
# ============================================
type Subscription {
"""
Subscribe to new posts
"""
postCreated: Post!
"""
Subscribe to post updates
"""
postUpdated(postId: ID!): Post!
"""
Subscribe to new comments
"""
commentCreated(postId: ID!): Comment!
}
# ============================================
# Scalars
# ============================================
"""
DateTime scalar for ISO 8601 timestamps
"""
scalar DateTime
"""
Schema definition
"""
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
{
"info": {
"name": "User Management API",
"description": "Complete API for managing users and posts",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{accessToken}}",
"type": "string"
}
]
},
"variable": [
{
"key": "baseUrl",
"value": "https://api.example.com/v1",
"type": "string"
},
{
"key": "accessToken",
"value": "",
"type": "string"
}
],
"item": [
{
"name": "Authentication",
"item": [
{
"name": "Login",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"user@example.com\",\n \"password\": \"password123\"\n}"
},
"url": {
"raw": "{{baseUrl}}/auth/login",
"host": ["{{baseUrl}}"],
"path": ["auth", "login"]
}
},
"response": [],
"event": [
{
"listen": "test",
"script": {
"exec": [
"const response = pm.response.json();",
"pm.environment.set('accessToken', response.accessToken);",
"pm.test('Status is 200', () => {",
" pm.response.to.have.status(200);",
"});",
"pm.test('Access token exists', () => {",
" pm.expect(response.accessToken).to.exist;",
"});"
]
}
}
]
}
]
},
{
"name": "Users",
"item": [
{
"name": "List Users",
"request": {
"method": "GET",
"url": {
"raw": "{{baseUrl}}/users?page=1&limit=20",
"host": ["{{baseUrl}}"],
"path": ["users"],
"query": [
{
"key": "page",
"value": "1"
},
{
"key": "limit",
"value": "20"
}
]
}
},
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status is 200', () => {",
" pm.response.to.have.status(200);",
"});",
"pm.test('Response has data array', () => {",
" const response = pm.response.json();",
" pm.expect(response.data).to.be.an('array');",
"});"
]
}
}
]
},
{
"name": "Create User",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"newuser@example.com\",\n \"username\": \"newuser\",\n \"password\": \"SecurePass123!\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n}"
},
"url": {
"raw": "{{baseUrl}}/users",
"host": ["{{baseUrl}}"],
"path": ["users"]
}
},
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status is 201', () => {",
" pm.response.to.have.status(201);",
"});",
"const response = pm.response.json();",
"pm.environment.set('userId', response.id);"
]
}
}
]
},
{
"name": "Get User",
"request": {
"method": "GET",
"url": {
"raw": "{{baseUrl}}/users/{{userId}}",
"host": ["{{baseUrl}}"],
"path": ["users", "{{userId}}"]
}
},
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status is 200', () => {",
" pm.response.to.have.status(200);",
"});",
"pm.test('User has email', () => {",
" const response = pm.response.json();",
" pm.expect(response.email).to.exist;",
"});"
]
}
}
]
}
]
}
]
}
Analyze API Structure
Generate OpenAPI Specification
Set Up Swagger UI
Document Async Operations
Generate Additional Formats
Before considering your API documentation complete:
You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.