@hedystia/swagger 1.1.5 → 1.2.0
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/package.json +2 -2
- package/readme.md +10 -9
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hedystia/swagger",
|
|
3
3
|
"module": "index.ts",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@types/bun": "latest",
|
|
7
7
|
"tsup": "^8.3.5"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@apidevtools/swagger-parser": "^10.1.1",
|
|
11
|
-
"hedystia": "^1.
|
|
11
|
+
"hedystia": "^1.2.0",
|
|
12
12
|
"openapi-types": "^12.1.3"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
package/readme.md
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
- 🧩 **Client integration** - Auto-generated type-safe HTTP client
|
|
27
27
|
- 🛡️ **Validation built-in** - Zod integration for runtime safety
|
|
28
28
|
- 🔌 **Extensible architecture** - Middleware, hooks and macros system
|
|
29
|
+
- 📝 **Standard Schema** - Compatibility with the standard schema so you can use it with Zod, Arktype, etc.
|
|
29
30
|
|
|
30
31
|
## 🚀 Launch in 30 Seconds
|
|
31
32
|
|
|
@@ -36,12 +37,12 @@ bun add hedystia
|
|
|
36
37
|
|
|
37
38
|
2. Create your first API:
|
|
38
39
|
```typescript
|
|
39
|
-
import { Hedystia,
|
|
40
|
+
import { Hedystia, h } from "hedystia";
|
|
40
41
|
|
|
41
42
|
const app = new Hedystia()
|
|
42
43
|
.get("/hello/:name", (ctx) => `Hello ${ctx.params.name}!`, {
|
|
43
|
-
params:
|
|
44
|
-
response:
|
|
44
|
+
params: h.object({ name: h.string() }),
|
|
45
|
+
response: h.string()
|
|
45
46
|
})
|
|
46
47
|
.listen(3000);
|
|
47
48
|
```
|
|
@@ -63,9 +64,9 @@ console.log(data); // "Hello World!"
|
|
|
63
64
|
```typescript
|
|
64
65
|
// Server-side validation
|
|
65
66
|
.post("/users", (ctx) => {...}, {
|
|
66
|
-
body:
|
|
67
|
-
email:
|
|
68
|
-
age:
|
|
67
|
+
body: h.object({
|
|
68
|
+
email: h.email(),
|
|
69
|
+
age: h.number()
|
|
69
70
|
})
|
|
70
71
|
})
|
|
71
72
|
|
|
@@ -110,7 +111,7 @@ app.use("/swagger", swaggerPlugin.plugin).listen(3000);
|
|
|
110
111
|
|
|
111
112
|
// Binary responses
|
|
112
113
|
.get("/pdf", () => new Blob([...]), {
|
|
113
|
-
response:
|
|
114
|
+
response: h.instanceof(Blob)
|
|
114
115
|
})
|
|
115
116
|
|
|
116
117
|
// Nested routing
|
|
@@ -129,12 +130,12 @@ app.use("/swagger", swaggerPlugin.plugin).listen(3000);
|
|
|
129
130
|
- ✅ Router Groups & Middleware
|
|
130
131
|
- ✅ Type-safe Client Generation
|
|
131
132
|
- ✅ WebSocket Support
|
|
133
|
+
- ✅ Standard Schema Compatibility
|
|
132
134
|
|
|
133
135
|
### Advanced Capabilities
|
|
134
|
-
- ✅ Zod Validation
|
|
136
|
+
- ✅ Zod Validation - Changed to native validation plugin
|
|
135
137
|
- ✅ Hooks System (onRequest, onError, etc)
|
|
136
138
|
- ✅ Macro System for Auth/Rate Limiting
|
|
137
|
-
- 🚧 File System Routing
|
|
138
139
|
- ✅ OpenAPI - Swagger Integration
|
|
139
140
|
|
|
140
141
|
## 💼 Production Ready
|