Skip to content

Commit

Permalink
fix: handle case where items is array in indexer
Browse files Browse the repository at this point in the history
fixes #304
  • Loading branch information
RomanHotsiy committed Jul 20, 2017
1 parent 6bb3bd8 commit 5e5db72
Show file tree
Hide file tree
Showing 3 changed files with 601 additions and 134 deletions.
8 changes: 7 additions & 1 deletion lib/services/search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,13 @@ export class SearchService {
let body = schema.description; // TODO: defaults, examples, etc...

if (schema.type === 'array') {
this.indexSchema(schema.items, title, JsonPointer.join(absolutePointer, ['items']), menuPointer, parent);
if (Array.isArray(schema.items)) {
schema.items.map((itemSchema, idx) => {
this.indexSchema(itemSchema, title, JsonPointer.join(absolutePointer, ['items', idx]), menuPointer, parent);
});
} else {
this.indexSchema(schema.items, title, JsonPointer.join(absolutePointer, ['items']), menuPointer, parent);
}
return;
}

Expand Down
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,24 @@
"author": "Roman Hotsiy",
"license": "MIT",
"devDependencies": {
"@angular/common": "^4.2.4",
"@angular/compiler": "^4.2.4",
"@angular/compiler-cli": "^4.2.4",
"@angular/core": "^4.2.4",
"@angular/platform-browser": "^4.2.4",
"@angular/platform-browser-dynamic": "^4.2.4",
"@angular/platform-server": "^4.2.4",
"@angular/common": "^4.3.1",
"@angular/compiler": "^4.3.1",
"@angular/compiler-cli": "^4.3.1",
"@angular/core": "^4.3.1",
"@angular/platform-browser": "^4.3.1",
"@angular/platform-browser-dynamic": "^4.3.1",
"@angular/platform-server": "^4.3.1",
"@types/jasmine": "^2.5.53",
"@types/requirejs": "^2.1.29",
"@types/should": "^8.3.0",
"@types/swagger-schema-official": "^2.0.5",
"@types/webpack": "^3.0.0",
"@types/webpack": "^3.0.4",
"angular2-template-loader": "^0.6.2",
"awesome-typescript-loader": "^3.1.3",
"awesome-typescript-loader": "^3.2.1",
"branch-release": "^1.0.3",
"chalk": "^1.1.3",
"codelyzer": "^3.0.1",
"conventional-changelog-cli": "^1.3.1",
"chalk": "^2.0.1",
"codelyzer": "^3.1.2",
"conventional-changelog-cli": "^1.3.2",
"core-js": "^2.4.1",
"css-loader": "^0.28.1",
"deploy-to-gh-pages": "^1.3.3",
Expand All @@ -92,7 +92,7 @@
"karma-should": "^1.0.0",
"karma-sinon": "^1.0.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.3",
"karma-webpack": "^2.0.4",
"mark.js": "github:julmot/mark.js",
"node-sass": "^4.5.3",
"openapi-sampler": "^0.4.1",
Expand All @@ -102,25 +102,25 @@
"raw-loader": "^0.5.1",
"remarkable": "1.7.1",
"rimraf": "^2.6.1",
"rxjs": "^5.4.1",
"rxjs": "^5.4.2",
"sass-loader": "^6.0.6",
"scrollparent": "^2.0.1",
"shelljs": "^0.7.7",
"should": "^11.2.1",
"sinon": "^2.3.5",
"sinon": "^2.3.8",
"slugify": "^1.0.2",
"source-map-loader": "^0.2.1",
"stream-http": "^2.7.0",
"string-replace-webpack-plugin": "^0.1.3",
"style-loader": "^0.18.2",
"swagger-schema-official": "^2.0.0-bab6bed",
"ts-helpers": "^1.1.1",
"tslint": "^5.2.0",
"typescript": "^2.3.2",
"webpack": "^3.0.0",
"webpack-dev-server": "^2.5.0",
"tslint": "^5.5.0",
"typescript": "^2.4.2",
"webpack": "^3.3.0",
"webpack-dev-server": "^2.5.1",
"webpack-merge": "^4.1.0",
"zone.js": "^0.8.10"
"zone.js": "^0.8.14"
},
"dependencies": {
"lunr": "1.0.0",
Expand Down

0 comments on commit 5e5db72

Please sign in to comment.