mirror of
https://github.com/Redocly/redoc.git
synced 2025-03-03 17:35:46 +03:00
Prepend api url to paths
This commit is contained in:
parent
bd40107e56
commit
540a050eaa
|
@ -3,7 +3,7 @@
|
|||
<h2>{{data.methodInfo.summary}}</h2>
|
||||
<h3>
|
||||
<span class="http-method" [ng-class]="data.method">{{data.method}}</span>
|
||||
<span class="path">{{data.path}}</span>
|
||||
<span class="api-url">{{data.apiUrl}}</span> <span class="path">{{data.path}}</span>
|
||||
</h3>
|
||||
<div class="method-tags"> Tags:
|
||||
<a *ng-for="#tag of data.methodInfo.tags" attr.href="#{{tag}}"> {{tag}} </a>
|
||||
|
|
|
@ -20,6 +20,7 @@ export default class Method extends BaseComponent {
|
|||
|
||||
prepareModel() {
|
||||
this.data = {};
|
||||
this.data.apiUrl = this.schemaMgr.apiUrl;
|
||||
this.data.method = JsonPointer.baseName(this.pointer);
|
||||
this.data.path = JsonPointer.baseName(this.pointer, 2);
|
||||
this.data.methodInfo = this.componentSchema;
|
||||
|
|
|
@ -27,6 +27,7 @@ export default class SchemaManager {
|
|||
(schema) => {
|
||||
this._schema = schema;
|
||||
resolve(this._schema);
|
||||
this.init();
|
||||
},
|
||||
(err) => reject(err)
|
||||
);
|
||||
|
@ -35,6 +36,11 @@ export default class SchemaManager {
|
|||
return promise;
|
||||
}
|
||||
|
||||
/* calculate common used values */
|
||||
init() {
|
||||
this.apiUrl = this._schema.schemes[0] + "://" + this._schema.host + this._schema.basePath;
|
||||
}
|
||||
|
||||
get schema() {
|
||||
// TODO: consider returning promise
|
||||
return this._schema;
|
||||
|
|
Loading…
Reference in New Issue
Block a user