mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-07 13:30:33 +03:00
prepend v to api version
This commit is contained in:
parent
2d54a67c2c
commit
6a8f1e6e21
|
@ -39,7 +39,7 @@ describe('Redoc components', () => {
|
||||||
it('should render api name and version', () => {
|
it('should render api name and version', () => {
|
||||||
let nativeElement = getChildDebugElement(fixture.debugElement, 'api-info').nativeElement;
|
let nativeElement = getChildDebugElement(fixture.debugElement, 'api-info').nativeElement;
|
||||||
let headerElement = nativeElement.querySelector('h1');
|
let headerElement = nativeElement.querySelector('h1');
|
||||||
expect(headerElement.innerText).toContain('Swagger Petstore (1.0.0)');
|
expect(headerElement.innerText).toContain('Swagger Petstore (v1.0.0)');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -18,5 +18,8 @@ export class ApiInfo extends BaseComponent {
|
||||||
prepareModel() {
|
prepareModel() {
|
||||||
this.data = this.componentSchema.info;
|
this.data = this.componentSchema.info;
|
||||||
this.specUrl = this.optionsService.options.specUrl;
|
this.specUrl = this.optionsService.options.specUrl;
|
||||||
|
if (parseInt(this.data.version.substring(0, 1)) !== NaN) {
|
||||||
|
this.data.version = 'v' + this.data.version;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user