Skip to content

Commit

Permalink
Fix cdimascio#699 serdes missed on items in a collection.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertjustjones committed Jun 16, 2022
1 parent 6448f45 commit e4a67e3
Show file tree
Hide file tree
Showing 3 changed files with 584 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/middlewares/parsers/schema.preprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type Schema = ReferenceObject | SchemaObject;
if (!Array.prototype['flatMap']) {
// polyfill flatMap
// TODO remove me when dropping node 10 support
Array.prototype['flatMap'] = function (lambda) {
Array.prototype['flatMap'] = function(lambda) {
return Array.prototype.concat.apply([], this.map(lambda));
};
Object.defineProperty(Array.prototype, 'flatMap', { enumerable: false });
Expand Down Expand Up @@ -199,6 +199,9 @@ export class SchemaPreprocessor {
const child = new Node(node, s, [...node.path, 'anyOf', i + '']);
recurse(node, child, opts);
});
} else if (/*schema.type == 'array' && */ schema.items) {
const child = new Node(node, schema.items, [...node.path, 'items']);
recurse(node, child, opts);
} else if (schema.properties) {
Object.entries(schema.properties).forEach(([id, cschema]) => {
const path = [...node.path, 'properties', id];
Expand Down
Loading

0 comments on commit e4a67e3

Please sign in to comment.