Skip to content

Commit

Permalink
fix #373: missing schemaprocessor implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
daniele-pecora committed Dec 12, 2020
1 parent cd952a9 commit c1e818b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 2.4.12 (2020-12-03)
- fix #373: missing schemaprocessor implementation

# 2.4.11 (2020-12-03)
- fix #373: add support for array items with different schema definitions

Expand Down
2 changes: 1 addition & 1 deletion projects/schema-form/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-schema-form",
"version": "2.4.11",
"version": "2.4.12",
"repository": {
"type": "git",
"url": "git+https://github.com/guillotinaweb/ngx-schema-form"
Expand Down
11 changes: 10 additions & 1 deletion projects/schema-form/src/lib/model/schemapreprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,16 @@ export class SchemaPreprocessor {
}
}
} else if (jsonSchema.type === 'array') {
SchemaPreprocessor.preprocess(jsonSchema.items, path + '*/');
if (Array.isArray(jsonSchema.items || {})) {
for (let i = 0; i < jsonSchema.items.length; i++) {
SchemaPreprocessor.preprocess(jsonSchema.items[i], path + '*/');
}
} else {
SchemaPreprocessor.preprocess(jsonSchema.items, path + '*/');
}
if (jsonSchema.additionalItems) {
SchemaPreprocessor.preprocess(jsonSchema.additionalItems, path + '*/');
}
}
}

Expand Down

0 comments on commit c1e818b

Please sign in to comment.