Skip to content

Commit e4a67e3

Browse files
Fix cdimascio#699 serdes missed on items in a collection.
1 parent 6448f45 commit e4a67e3

File tree

3 files changed

+584
-1
lines changed

3 files changed

+584
-1
lines changed

src/middlewares/parsers/schema.preprocessor.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ type Schema = ReferenceObject | SchemaObject;
5656
if (!Array.prototype['flatMap']) {
5757
// polyfill flatMap
5858
// TODO remove me when dropping node 10 support
59-
Array.prototype['flatMap'] = function (lambda) {
59+
Array.prototype['flatMap'] = function(lambda) {
6060
return Array.prototype.concat.apply([], this.map(lambda));
6161
};
6262
Object.defineProperty(Array.prototype, 'flatMap', { enumerable: false });
@@ -199,6 +199,9 @@ export class SchemaPreprocessor {
199199
const child = new Node(node, s, [...node.path, 'anyOf', i + '']);
200200
recurse(node, child, opts);
201201
});
202+
} else if (/*schema.type == 'array' && */ schema.items) {
203+
const child = new Node(node, schema.items, [...node.path, 'items']);
204+
recurse(node, child, opts);
202205
} else if (schema.properties) {
203206
Object.entries(schema.properties).forEach(([id, cschema]) => {
204207
const path = [...node.path, 'properties', id];

0 commit comments

Comments
 (0)