Skip to content

Commit 5ec3f70

Browse files
committed
AB-289-removed-undefined-props
1 parent 7217383 commit 5ec3f70

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

libV2/schemaUtils.js

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -749,15 +749,15 @@ let QUERYPARAM = 'query',
749749
const propertyDetails = {
750750
type: prop.type || 'unknown',
751751
required: requiredProperties.has(key) || parentRequired.has(key),
752-
enum: prop.enum || null,
753-
minLength: prop.minLength || null,
754-
maxLength: prop.maxLength || null,
755-
minimum: prop.minimum || null,
756-
maximum: prop.maximum || null,
757-
pattern: prop.pattern || null,
758-
example: prop.example || null,
759-
description: prop.description || null,
760-
format: prop.format || null
752+
enum: prop.enum || undefined,
753+
minLength: prop.minLength || undefined,
754+
maxLength: prop.maxLength || undefined,
755+
minimum: prop.minimum || undefined,
756+
maximum: prop.maximum || undefined,
757+
pattern: prop.pattern || undefined,
758+
example: prop.example || undefined,
759+
description: prop.description || undefined,
760+
format: prop.format || undefined
761761
};
762762
if (prop.$ref) {
763763
propertyDetails.properties = processSchema(prop);
@@ -848,13 +848,13 @@ let QUERYPARAM = 'query',
848848
properties = {
849849
type: prop.type || 'unknown',
850850
required: requiredProperties.has(key),
851-
enum: prop.enum || null,
852-
minLength: prop.minLength || null,
853-
maxLength: prop.maxLength || null,
854-
minimum: prop.minimum || null,
855-
maximum: prop.maximum || null,
856-
pattern: prop.pattern || null,
857-
example: prop.example || null
851+
enum: prop.enum || undefined,
852+
minLength: prop.minLength || undefined,
853+
maxLength: prop.maxLength || undefined,
854+
minimum: prop.minimum || undefined,
855+
maximum: prop.maximum || undefined,
856+
pattern: prop.pattern || undefined,
857+
example: prop.example || undefined
858858
};
859859
propertyDetails = { keyName, properties };
860860
if (keyName) {
@@ -2019,13 +2019,13 @@ let QUERYPARAM = 'query',
20192019
keyName = name;
20202020
properties = {
20212021
type: schema.type || 'unknown',
2022-
enum: schema.enum || null,
2023-
minLength: schema.minLength || null,
2024-
maxLength: schema.maxLength || null,
2025-
minimum: schema.minimum || null,
2026-
maximum: schema.maximum || null,
2027-
pattern: schema.pattern || null,
2028-
example: schema.example || null
2022+
enum: schema.enum || undefined,
2023+
minLength: schema.minLength || undefined,
2024+
maxLength: schema.maxLength || undefined,
2025+
minimum: schema.minimum || undefined,
2026+
maximum: schema.maximum || undefined,
2027+
pattern: schema.pattern || undefined,
2028+
example: schema.example || undefined
20292029
};
20302030
}
20312031
propertyDetails = { keyName, properties };
@@ -2078,13 +2078,13 @@ let QUERYPARAM = 'query',
20782078
keyName = name;
20792079
properties = {
20802080
type: schema.type || 'unknown',
2081-
enum: schema.enum || null,
2082-
minLength: schema.minLength || null,
2083-
maxLength: schema.maxLength || null,
2084-
minimum: schema.minimum || null,
2085-
maximum: schema.maximum || null,
2086-
pattern: schema.pattern || null,
2087-
example: schema.example || null
2081+
enum: schema.enum || undefined,
2082+
minLength: schema.minLength || undefined,
2083+
maxLength: schema.maxLength || undefined,
2084+
minimum: schema.minimum || undefined,
2085+
maximum: schema.maximum || undefined,
2086+
pattern: schema.pattern || undefined,
2087+
example: schema.example || undefined
20882088
};
20892089
}
20902090
propertyDetails = { keyName, properties };
@@ -2168,13 +2168,13 @@ let QUERYPARAM = 'query',
21682168
keyName = name;
21692169
properties = {
21702170
type: schema.type || 'unknown',
2171-
enum: schema.enum || null,
2172-
minLength: schema.minLength || null,
2173-
maxLength: schema.maxLength || null,
2174-
minimum: schema.minimum || null,
2175-
maximum: schema.maximum || null,
2176-
pattern: schema.pattern || null,
2177-
example: schema.example || null
2171+
enum: schema.enum || undefined,
2172+
minLength: schema.minLength || undefined,
2173+
maxLength: schema.maxLength || undefined,
2174+
minimum: schema.minimum || undefined,
2175+
maximum: schema.maximum || undefined,
2176+
pattern: schema.pattern || undefined,
2177+
example: schema.example || undefined
21782178
};
21792179
}
21802180
propertyDetails = { keyName, properties };
@@ -2320,13 +2320,13 @@ let QUERYPARAM = 'query',
23202320
keyName = name;
23212321
properties = {
23222322
type: schema.type || 'unknown',
2323-
enum: schema.enum || null,
2324-
minLength: schema.minLength || null,
2325-
maxLength: schema.maxLength || null,
2326-
minimum: schema.minimum || null,
2327-
maximum: schema.maximum || null,
2328-
pattern: schema.pattern || null,
2329-
example: schema.example || null
2323+
enum: schema.enum || undefined,
2324+
minLength: schema.minLength || undefined,
2325+
maxLength: schema.maxLength || undefined,
2326+
minimum: schema.minimum || undefined,
2327+
maximum: schema.maximum || undefined,
2328+
pattern: schema.pattern || undefined,
2329+
example: schema.example || undefined
23302330
};
23312331

23322332
}

0 commit comments

Comments
 (0)