Skip to content

Commit 6daadf6

Browse files
🩹 fix(OpenAPI): Servers in initialization
1 parent 118eac5 commit 6daadf6

8 files changed

Lines changed: 15 additions & 4 deletions

File tree

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@murat/yelix",
33
"exports": "./mod.ts",
4-
"version": "0.1.24",
4+
"version": "0.1.25",
55
"license": "MIT",
66
"nodeModulesDir": "auto",
77
"tasks": {

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@murat/yelix",
3-
"version": "0.1.24",
3+
"version": "0.1.25",
44
"license": "MIT",
55
"exports": {
66
".": "./mod.ts",

src/OpenAPI/Core.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class YelixOpenAPI {
1616
description: params.description || "Yelix API Documentation",
1717
},
1818
paths: {},
19+
servers: params.servers || [],
1920
};
2021
}
2122

src/OpenAPI/openAPI.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ type OpenAPIParams = {
698698
version: string;
699699
title: string;
700700
description?: string;
701+
servers?: OpenAPIServer[];
701702
};
702703

703704
type AddOpenAPIEndpointResponseParams = {

src/core/DocsManager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export class DocsManager {
2222
title: config.title || "Yelix API",
2323
version: config.version || "1.0.0",
2424
description: config.description || "Yelix API Documentation",
25+
servers: config.servers || [],
2526
});
2627

2728
this.app.get("/yelix-openapi-raw", (c) => {

testing/api/nocache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const middlewares = ["dataValidation"];
2121
// API endpoint data validation
2222
export const validation: ValidationType = {
2323
query: {
24-
name: z.string(),
24+
name: z.string().min(3),
2525
},
2626
};
2727

testing/main.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,17 @@ async function main() {
2828
url: "http://localhost:3030",
2929
description: "Local Server",
3030
},
31+
{
32+
url: "http://localhost:3080",
33+
description: "Test Server",
34+
},
3135
],
3236
});
3337

38+
app.docsManager.YelixOpenAPI?.customValidationDescription("min", () => {
39+
return "hello world!";
40+
});
41+
3442
const hello: Endpoint = {
3543
path: "/hello",
3644
GET: (ctx: Ctx) => {

version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
const version = '0.1.24';
1+
const version = '0.1.25';
22
export default version;

0 commit comments

Comments
 (0)