Skip to content

Commit 48e7832

Browse files
committed
fix accepted options for mapping
1 parent b3fd06d commit 48e7832

File tree

1 file changed

+38
-28
lines changed

1 file changed

+38
-28
lines changed

lib/options.schema.json

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,7 @@
3333
"properties": {},
3434
"patternProperties": {
3535
".*": {
36-
"oneOf": [{
37-
"description": "Output key to map value onto within destination object",
38-
"type": "string"
39-
}, {
40-
"description": "List of outputs within destination object",
41-
"type": "array",
42-
"items": {
43-
"oneOf": [{
44-
"description": "Output key to map value onto within destination object",
45-
"type": "string"
46-
}, {
47-
"type": "object",
48-
"additionalProperties": true,
49-
"properties": {
50-
"key": {
51-
"description": "Output key to map value onto within destination object",
52-
"type": "string"
53-
},
54-
"transform": {
55-
"description": "Function to transform the output value; see also: https://github.com/wankdanker/node-object-mapper",
56-
"type": "object",
57-
"additionalProperties": true
58-
}
59-
},
60-
"required": ["key"]
61-
}]
62-
}
63-
}]
36+
"$ref": "#/definitions/PropertyMappingItem"
6437
}
6538
}
6639
},
@@ -87,5 +60,42 @@
8760
"additionalProperties": true
8861
}]
8962
}
63+
},
64+
"definitions": {
65+
"PropertyMappingItem": {
66+
"oneOf": [{
67+
"description": "Output key to map value onto within destination object",
68+
"type": "string"
69+
}, {
70+
"description": "List of outputs within destination object",
71+
"type": "array",
72+
"items": {
73+
"oneOf": [{
74+
"description": "Output key to map value onto within destination object",
75+
"type": "string"
76+
}, {
77+
"$ref": "#/definitions/PropertyMappingObject"
78+
}]
79+
}
80+
}, {
81+
"$ref": "#/definitions/PropertyMappingObject"
82+
}]
83+
},
84+
"PropertyMappingObject": {
85+
"type": "object",
86+
"additionalProperties": true,
87+
"properties": {
88+
"key": {
89+
"description": "Output key to map value onto within destination object",
90+
"type": "string"
91+
},
92+
"transform": {
93+
"description": "Function to transform the output value; see also: https://github.com/wankdanker/node-object-mapper",
94+
"type": "object",
95+
"additionalProperties": true
96+
}
97+
},
98+
"required": ["key"]
99+
}
90100
}
91101
}

0 commit comments

Comments
 (0)