@kanjijs/openapi 0.2.0-beta.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.
Files changed (3) hide show
  1. package/README.md +27 -0
  2. package/dist/index.js +6411 -0
  3. package/package.json +24 -0
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # @kanjijs/openapi
2
+
3
+ Metadata reflection and OpenAPI specification generator for Kanjijs Framework.
4
+
5
+ ## How it works
6
+
7
+ This package inspects the runtime metadata stored by `@kanjijs/core` decorators (`@Controller`, `@Get`, etc.) and the Zod schemas from descriptors to build a compliant **OpenAPI v3.0** JSON object.
8
+
9
+ ## Usage
10
+
11
+ Typically used via the CLI (`kanjijs openapi`), but you can use it programmatically:
12
+
13
+ ```typescript
14
+ import { OpenApiGenerator } from "@kanjijs/openapi";
15
+ import { AppModule } from "./app.module";
16
+
17
+ // Generate Spec
18
+ const spec = OpenApiGenerator.generate(AppModule);
19
+
20
+ console.log(JSON.stringify(spec, null, 2));
21
+ ```
22
+
23
+ ## Features
24
+
25
+ - **Automatic Path Discovery**: Scans modules and controllers.
26
+ - **Zod to JSON Schema**: Converts Zod validation schemas into OpenAPI schemas.
27
+ - **Operation IDs**: Generates predictable IDs based on method names.