We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, only the authentication routes (/auth/register and /auth/login) are well documented with Swagger decorators.
/auth/register
/auth/login
We need to extend this documentation to all API endpoints for a better developer experience.
Current example of well-documented endpoint:
export class LoginDto { @ApiProperty({ example: '[email protected]', }) @IsEmail() email!: string; @ApiProperty({ example: 'password123', minLength: 5, maxLength: 20, }) @IsString() password!: string; }
Products
/products
/products/topRated
/products/:id
products/:id
/products/:id/review
Orders
/orders
/orders/myorders
/orders/:id
/orders/:id/pay
/orders/:id/deliver
Cart
/cart
/cart/shipping
/cart/payment
Users
/users
/users/:id
Upload
@ApiTags('products') @Controller('products') export class ProductsController { @ApiOperation({ summary: 'Get all products' }) @ApiQuery({ name: 'keyword', required: false, description: 'Search keyword' }) @ApiQuery({ name: 'pageId', required: false, description: 'Page number' }) @ApiResponse({ status: 200, description: 'Returns paginated products', type: PaginatedProductsResponse }) @ApiResponse({ status: 404, description: 'No products found' }) @Get() getProducts( @Query('keyword') keyword: string, @Query('pageId') pageId: string, ) { return this.productsService.findMany(keyword, pageId); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description:
Currently, only the authentication routes (
/auth/register
and/auth/login
) are well documented with Swagger decorators.We need to extend this documentation to all API endpoints for a better developer experience.
Current example of well-documented endpoint:
Tasks
Products
endpoints:/products
- List products with pagination/products/topRated
- Get top rated products/products/:id
- Get single product/products
- Create product (admin)products/:id
- Update product (admin)/products/:id
- Delete product (admin)/products/:id/review
- Create product reviewOrders
endpoints:/orders
- Create order/orders
- Get all orders (admin)/orders/myorders
- Get user orders/orders/:id
- Get order by ID/orders/:id/pay
- Update order to paid/orders/:id/deliver
- Update order to deliveredCart
endpoints:/cart
- Add to cart/cart/shipping
- Save shipping address/cart/payment
- Save payment methodUsers
endpoints:/users
- Get all users (admin)/users/:id
- Delete user (admin)/users/:id
- Get user by ID (admin)/users/:id
- Update user (admin)Upload
endpoint:For each endpoint, include:
Example Implentation:
The text was updated successfully, but these errors were encountered: