File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @murat/openapi" ,
33 "exports" : " ./mod.ts" ,
4- "version" : " 0.1.11 " ,
4+ "version" : " 0.1.12 " ,
55 "tasks" : {
66 "lint" : " deno lint" ,
77 "test" : " deno test --allow-all" ,
Original file line number Diff line number Diff line change 11{
22 "name" : " @murat/openapi" ,
3- "version" : " 0.1.11 " ,
3+ "version" : " 0.1.12 " ,
44 "license" : " MIT" ,
55 "exports" : " ./mod.ts" ,
66 "imports" : {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import type {
22 OpenAPICore ,
33 OpenAPIPathItem ,
44 OpenAPISecurityRequirement ,
5+ OpenAPISecurityTypes ,
56 OpenAPITag ,
67} from './Core.types.ts' ;
78import { createEndpointBuilder , EndpointBuilder } from './EndpointBuilder.ts' ;
@@ -195,6 +196,17 @@ class OpenAPI {
195196 } ;
196197 return this ;
197198 }
199+
200+ addSecuritySchema ( name : string , schema : { type : OpenAPISecurityTypes ; description ?: string } ) : this {
201+ if ( ! this . raw . components ) {
202+ this . raw . components = { securitySchemes : { } } ;
203+ }
204+ if ( ! this . raw . components . securitySchemes ) {
205+ this . raw . components . securitySchemes = { } ;
206+ }
207+ this . raw . components . securitySchemes [ name ] = schema ;
208+ return this ;
209+ }
198210}
199211
200212export { createEndpointBuilder , createEndpointPath , OpenAPI } ;
You can’t perform that action at this time.
0 commit comments