File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed
apps/meteor/app/api/server Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -48,5 +48,6 @@ import './v1/voip/omnichannel';
4848import './v1/voip' ;
4949import './v1/federation' ;
5050import './v1/moderation' ;
51+ import './openApi' ;
5152
5253export { API , APIClass , defaultRateLimiterOptions } from './api' ;
Original file line number Diff line number Diff line change 1+ import { API } from './api' ;
2+ import { settings } from '../../settings/server' ;
3+ import { Info } from '../../utils/rocketchat.info' ;
4+
5+ const openApi = new API . ApiClass ( {
6+ version : 'json' ,
7+ useDefaultAuth : false ,
8+ prettyJson : false ,
9+ enableCors : false ,
10+ auth : API . getUserAuth ( ) ,
11+ } ) ;
12+
13+ openApi . addRoute ( '/' , {
14+ get ( ) {
15+ return {
16+ openapi : '3.0.3' ,
17+ info : {
18+ title : 'Rocket.Chat API' ,
19+ description : 'Rocket.Chat API' ,
20+ version : Info . version ,
21+ } ,
22+ servers : [
23+ {
24+ url : settings . get ( 'Site_Url' ) ,
25+ } ,
26+ ] ,
27+ components : {
28+ securitySchemes : {
29+ userId : {
30+ type : 'apiKey' ,
31+ in : 'header' ,
32+ name : 'X-User-Id' ,
33+ } ,
34+ authToken : {
35+ type : 'apiKey' ,
36+ in : 'header' ,
37+ name : 'X-Auth-Token' ,
38+ } ,
39+ } ,
40+ schemas : { } ,
41+ } ,
42+ paths : API . v1 . typedRoutes ,
43+ } ;
44+ } ,
45+ } ) ;
You can’t perform that action at this time.
0 commit comments