diff --git a/lib/components/ApiInfo/api-info.spec.ts b/lib/components/ApiInfo/api-info.spec.ts index d85efd66..acaebf1c 100644 --- a/lib/components/ApiInfo/api-info.spec.ts +++ b/lib/components/ApiInfo/api-info.spec.ts @@ -39,7 +39,7 @@ describe('Redoc components', () => { it('should render api name and version', () => { let nativeElement = getChildDebugElement(fixture.debugElement, 'api-info').nativeElement; let headerElement = nativeElement.querySelector('h1'); - expect(headerElement.innerText).toContain('Swagger Petstore (1.0.0)'); + expect(headerElement.innerText).toContain('Swagger Petstore (v1.0.0)'); }); }); }); diff --git a/lib/components/ApiInfo/api-info.ts b/lib/components/ApiInfo/api-info.ts index 2a8c20bf..db5db8a0 100644 --- a/lib/components/ApiInfo/api-info.ts +++ b/lib/components/ApiInfo/api-info.ts @@ -18,5 +18,8 @@ export class ApiInfo extends BaseComponent { prepareModel() { this.data = this.componentSchema.info; this.specUrl = this.optionsService.options.specUrl; + if (parseInt(this.data.version.substring(0, 1)) !== NaN) { + this.data.version = 'v' + this.data.version; + } } }