2015-10-08 23:21:51 +03:00
|
|
|
'use strict';
|
|
|
|
|
2015-10-09 23:19:35 +03:00
|
|
|
import {RedocComponent, BaseComponent} from '../base';
|
2015-10-08 23:21:51 +03:00
|
|
|
import {methods as swaggerMethods} from '../../utils/swagger-defs';
|
|
|
|
import {Method} from '../Method/method';
|
|
|
|
|
2015-10-09 23:19:35 +03:00
|
|
|
@RedocComponent({
|
2015-10-08 23:21:51 +03:00
|
|
|
selector: 'methods-list',
|
|
|
|
templateUrl: './lib/components/MethodsList/methods-list.html',
|
2015-10-09 23:19:35 +03:00
|
|
|
directives: [Method]
|
2015-10-08 23:21:51 +03:00
|
|
|
})
|
2015-10-09 23:19:35 +03:00
|
|
|
export class MethodsList extends BaseComponent {
|
2015-10-08 23:21:51 +03:00
|
|
|
|
|
|
|
constructor(schemaMgr) {
|
2015-10-09 23:19:35 +03:00
|
|
|
super(schemaMgr);
|
2015-10-08 23:21:51 +03:00
|
|
|
}
|
|
|
|
|
2015-10-09 23:19:35 +03:00
|
|
|
prepareModel() {
|
2015-10-08 23:21:51 +03:00
|
|
|
this.data = {};
|
2015-10-09 23:19:35 +03:00
|
|
|
let pathInfo = this.componentSchema;
|
2015-10-08 23:21:51 +03:00
|
|
|
|
|
|
|
this.data.methods = Object.keys(pathInfo).filter((k) => swaggerMethods.has(k));
|
2015-10-10 15:34:46 +03:00
|
|
|
// TODO: check $ref field
|
2015-10-08 23:21:51 +03:00
|
|
|
}
|
|
|
|
}
|