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