diff --git a/lib/components/ApiInfo/api-info.ts b/lib/components/ApiInfo/api-info.ts index 2ea4f63423..2138a64add 100644 --- a/lib/components/ApiInfo/api-info.ts +++ b/lib/components/ApiInfo/api-info.ts @@ -24,7 +24,7 @@ export class ApiInfo extends BaseComponent implements OnInit { init() { this.info = this.componentSchema.info; this.specUrl = this.optionsService.options.specUrl; - if (!isNaN(parseInt(this.info.version.substring(0, 1)))) { + if (!isNaN(parseInt(this.info.version.toString().substring(0, 1)))) { this.info.version = 'v' + this.info.version; } } diff --git a/lib/utils/spec-manager.ts b/lib/utils/spec-manager.ts index 951a18c098..379f624a41 100644 --- a/lib/utils/spec-manager.ts +++ b/lib/utils/spec-manager.ts @@ -83,7 +83,7 @@ export class SpecManager { preprocess() { let mdRender = new MdRenderer(); if (!this._schema.info) { - throw 'Required field "info" is not specified at the spec top level'; + throw Error('Specification Error: Required field "info" is not specified at the top level of the specification'); } if (!this._schema.info.description) this._schema.info.description = ''; if (this._schema.securityDefinitions) {