Skip to content

Commit 278ad55

Browse files
committed
Small fix to add 'no' option to list
certain apis provide a list of valid options, but null is also an option.. this essentially adds that null option so that we can call without providing a parameter. this is useful in github's api
1 parent 8c4a0a6 commit 278ad55

File tree

1 file changed

+6
-0
lines changed
  • server/node-service/src/plugins/openApi/parse

1 file changed

+6
-0
lines changed

server/node-service/src/plugins/openApi/parse/oas3.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ const schemaToActionParamConfig = (
4444
const paramType = getOpenApiV3ParamType(type, schema.format || "", !!options);
4545
const defaultValue = example || getSchemaExample(schema);
4646
const shouldJsonStringify = type === "array" || type === "object";
47+
// add an empty option for select lists for things that aren't required
48+
if (paramType === "select") {
49+
if (!options?.includes("")) {
50+
options?.push("")
51+
}
52+
}
4753
const param: ActionParamConfig = {
4854
label: name,
4955
tooltip: desc || schema.description,

0 commit comments

Comments
 (0)