Skip to content

Commit 64c816e

Browse files
committed
combine
1 parent f393c70 commit 64c816e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/SchemaToINodeProperties.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {SchemaExample} from "./openapi/SchemaExample";
77
type Schema = OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject;
88
type FromSchemaNodeProperty = Pick<INodeProperties, 'type' | 'default' | 'description' | 'options'>;
99

10-
function combineINodeProperties(...sources: Partial<INodeProperties>[]): INodeProperties {
10+
function combine(...sources: Partial<INodeProperties>[]): INodeProperties {
1111
const obj = lodash.defaults({}, ...sources)
1212
if (!obj.required) {
1313
// n8n does want to have required: false|null|undefined
@@ -96,7 +96,7 @@ export class N8NINodeProperties {
9696
description: parameter.description,
9797
default: parameter.example,
9898
};
99-
const field = combineINodeProperties(fieldParameterKeys, fieldSchemaKeys)
99+
const field = combine(fieldParameterKeys, fieldSchemaKeys)
100100

101101
switch (parameter.in) {
102102
case "query":
@@ -147,7 +147,7 @@ export class N8NINodeProperties {
147147
displayName: lodash.startCase(name),
148148
name: name,
149149
}
150-
const field = combineINodeProperties(fieldParameterKeys, fieldSchemaKeys)
150+
const field = combine(fieldParameterKeys, fieldSchemaKeys)
151151
return field
152152
}
153153

@@ -174,7 +174,7 @@ export class N8NINodeProperties {
174174
const fieldDefaults: Partial<INodeProperties> = {
175175
required: !!schema.required
176176
}
177-
const field = combineINodeProperties(fieldDefaults, fieldPropertyKeys)
177+
const field = combine(fieldDefaults, fieldPropertyKeys)
178178
field.routing = {
179179
request: {
180180
body: '={{ JSON.parse($value) }}'
@@ -191,7 +191,7 @@ export class N8NINodeProperties {
191191
const fieldDefaults: Partial<INodeProperties> = {
192192
required: schema.required && schema.required?.includes(key),
193193
}
194-
const field = combineINodeProperties(fieldDefaults, fieldPropertyKeys)
194+
const field = combine(fieldDefaults, fieldPropertyKeys)
195195
if (field.type === 'json') {
196196
field.routing = {
197197
request: {

0 commit comments

Comments
 (0)