Skip to content

Commit

Permalink
Small fix to add 'no' option to list
Browse files Browse the repository at this point in the history
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
  • Loading branch information
snowe2010 committed Mar 15, 2024
1 parent 8c4a0a6 commit 278ad55
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/node-service/src/plugins/openApi/parse/oas3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ const schemaToActionParamConfig = (
const paramType = getOpenApiV3ParamType(type, schema.format || "", !!options);
const defaultValue = example || getSchemaExample(schema);
const shouldJsonStringify = type === "array" || type === "object";
// add an empty option for select lists for things that aren't required
if (paramType === "select") {
if (!options?.includes("")) {
options?.push("")
}
}
const param: ActionParamConfig = {
label: name,
tooltip: desc || schema.description,
Expand Down

0 comments on commit 278ad55

Please sign in to comment.