File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff line change 11{
22 "name" : " @murat/yelix" ,
3- "version" : " 0.1.24 " ,
3+ "version" : " 0.1.25 " ,
44 "license" : " MIT" ,
55 "exports" : {
66 "." : " ./mod.ts" ,
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -698,6 +698,7 @@ type OpenAPIParams = {
698698 version : string ;
699699 title : string ;
700700 description ?: string ;
701+ servers ?: OpenAPIServer [ ] ;
701702} ;
702703
703704type AddOpenAPIEndpointResponseParams = {
Original file line number Diff line number Diff 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 ) => {
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export const middlewares = ["dataValidation"];
2121// API endpoint data validation
2222export const validation : ValidationType = {
2323 query : {
24- name : z . string ( ) ,
24+ name : z . string ( ) . min ( 3 ) ,
2525 } ,
2626} ;
2727
Original file line number Diff line number Diff 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 ) => {
Original file line number Diff line number Diff line change 1- const version = '0.1.24 ' ;
1+ const version = '0.1.25 ' ;
22export default version ;
You can’t perform that action at this time.
0 commit comments