Skip to content

Commit

Permalink
fix: do not crash if version is not string
Browse files Browse the repository at this point in the history
closes #208
  • Loading branch information
RomanHotsiy committed Feb 25, 2017
1 parent 9d0dd25 commit accd016
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/components/ApiInfo/api-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/spec-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit accd016

Please sign in to comment.