nextjs-auto-swagger-gen 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
# auto-swagger
|
|
1
|
+
# nextjs-auto-swagger-gen
|
|
2
2
|
|
|
3
3
|
> Zero-config, code-first API documentation generator for Next.js and Node.js
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/auto-swagger)
|
|
5
|
+
[](https://www.npmjs.com/package/nextjs-auto-swagger-gen)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://github.com/princeofv/auto-swagger)
|
|
7
8
|
|
|
8
9
|
**Write APIs normally. Docs generate themselves.**
|
|
9
10
|
|
|
@@ -19,13 +20,13 @@
|
|
|
19
20
|
|
|
20
21
|
```bash
|
|
21
22
|
# Using npm
|
|
22
|
-
npm install auto-swagger
|
|
23
|
+
npm install nextjs-auto-swagger-gen
|
|
23
24
|
|
|
24
25
|
# Using yarn
|
|
25
|
-
yarn add auto-swagger
|
|
26
|
+
yarn add nextjs-auto-swagger-gen
|
|
26
27
|
|
|
27
28
|
# Using pnpm
|
|
28
|
-
pnpm add auto-swagger
|
|
29
|
+
pnpm add nextjs-auto-swagger-gen
|
|
29
30
|
```
|
|
30
31
|
|
|
31
32
|
## Quick Start
|
|
@@ -47,7 +48,7 @@ npx auto-swagger serve
|
|
|
47
48
|
|
|
48
49
|
```typescript
|
|
49
50
|
// app/api-docs/route.ts
|
|
50
|
-
import { createDocsHandler } from 'auto-swagger';
|
|
51
|
+
import { createDocsHandler } from 'nextjs-auto-swagger-gen';
|
|
51
52
|
|
|
52
53
|
export const { GET } = createDocsHandler();
|
|
53
54
|
```
|
|
@@ -56,7 +57,7 @@ That's it! Visit `/api-docs` to see your documentation.
|
|
|
56
57
|
|
|
57
58
|
## How It Works
|
|
58
59
|
|
|
59
|
-
auto-swagger automatically:
|
|
60
|
+
nextjs-auto-swagger-gen automatically:
|
|
60
61
|
|
|
61
62
|
1. **Scans** your project for API route files
|
|
62
63
|
2. **Parses** TypeScript AST to understand your code
|
|
@@ -171,10 +172,10 @@ export async function DELETE(request: Request, { params }) {
|
|
|
171
172
|
|
|
172
173
|
## Configuration
|
|
173
174
|
|
|
174
|
-
Create `auto-swagger.config.js` in your project root:
|
|
175
|
+
Create `nextjs-auto-swagger-gen.config.js` in your project root:
|
|
175
176
|
|
|
176
177
|
```javascript
|
|
177
|
-
/** @type {import('auto-swagger').AutoSwaggerConfig} */
|
|
178
|
+
/** @type {import('nextjs-auto-swagger-gen').AutoSwaggerConfig} */
|
|
178
179
|
module.exports = {
|
|
179
180
|
// Scanner options
|
|
180
181
|
scanner: {
|