Response Object
Tags that define OpenAPI Response Object
@response
Syntax
@response {type} <code>[.contentType] <description>
@response <code>[.contentType] <description>{type}- Response body type (optional)code- HTTP status code (200, 404, etc.).contentType- MIME type (optional, default:application/json)description- Response description
Example
ts
/**
* @autoswag GET /users/{id}
* @pathParam {string} id User ID
* @response {User} 200 User found
* @response 404 User not found
*/
/**
* @autoswag DELETE /users/{id}
* @pathParam {string} id User ID
* @response 204 User deleted
* @response 404 User not found
*/