diff --git a/CHANGELOG.md b/CHANGELOG.md index 84764cab..a9900591 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ + +## [1.18.1](https://github.com/Rebilly/ReDoc/compare/v1.17.0...v1.18.1) (2017-08-28) + + +### Bug Fixes + +* crash if `contact` is not in the spec ([1b9ba0d](https://github.com/Rebilly/ReDoc/commit/1b9ba0d)), closes [#332](https://github.com/Rebilly/ReDoc/issues/332) + + # [1.18.0](https://github.com/Rebilly/ReDoc/compare/v1.16.1...v1.18.0) (2017-08-28) diff --git a/README.md b/README.md index f2e2c1f7..afc7f409 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ## [Live demo](http://rebilly.github.io/ReDoc/) -[](https://github.com/Rebilly/generator-openapi-repo#generator-openapi-repo--) +[Deploy to Github](https://github.com/Rebilly/generator-openapi-repo#generator-openapi-repo--) [ReDoc as a service](https://redoc.ly) [Customization services](https://redoc.ly/#services) ## Features - Extremely easy deployment diff --git a/demo/swagger.yaml b/demo/swagger.yaml index 88447235..45aeb0dc 100644 --- a/demo/swagger.yaml +++ b/demo/swagger.yaml @@ -39,6 +39,7 @@ info: termsOfService: 'http://swagger.io/terms/' contact: email: apiteam@swagger.io + url: https://github.com/Rebilly/ReDoc x-logo: url: 'https://rebilly.github.io/ReDoc/petstore-logo.png' license: diff --git a/lib/components/ApiLogo/api-logo.ts b/lib/components/ApiLogo/api-logo.ts index ff75ae12..f47fd61f 100644 --- a/lib/components/ApiLogo/api-logo.ts +++ b/lib/components/ApiLogo/api-logo.ts @@ -16,13 +16,12 @@ export class ApiLogo extends BaseComponent implements OnInit { } init() { - let logoInfo = this.componentSchema.info['x-logo']; - if ('url' in this.componentSchema.info['contact']) { - this.logo.url = this.componentSchema.info['contact']['url']; - } + const info = this.componentSchema.info; + const logoInfo = info['x-logo']; if (!logoInfo) return; this.logo.imgUrl = logoInfo.url; this.logo.bgColor = logoInfo.backgroundColor || 'transparent'; + this.logo.url = info.contact && info.contact.url || null; } ngOnInit() { diff --git a/package.json b/package.json index d6efc9d3..8c834f67 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "redoc", "description": "Swagger-generated API Reference Documentation", - "version": "1.18.0", + "version": "1.18.1", "repository": { "type": "git", "url": "git://github.com/Rebilly/ReDoc"