From 0e658c636088d98f54ba3ea181ccf9482fb5d64b Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 10 Feb 2023 16:03:36 +1100 Subject: [PATCH] Update 'swagger.yaml' test specifying input filename --- swagger.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/swagger.yaml b/swagger.yaml index f7546b1..4b58424 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -56,6 +56,10 @@ paths: schema: type: object properties: + infile: + type: string + description: Name of the json input file to utilise + #default: "/tmp/input.json" worksheet-name: type: string description: Label for the worksheet created in the spreadsheet @@ -80,7 +84,7 @@ paths: function: export-xlsx input: files: - - name: input.json + - name: /tmp/input.json data: | jq(.input) worksheet-name: "TestSpreadsheet" @@ -91,7 +95,7 @@ paths: x-direktiv: cmds: - action: exec - exec: /bin/json2excel -inputJson input.json -worksheetName "{{ .WorksheetName }}" -outputFilename '{{ .OutFilename }}' + exec: /bin/json2excel -inputJson {{- if eq (deref .Infile) "" }} "/tmp/input.json" {{- else }} {{ .Infile }} {{- end }} input.json -worksheetName "{{ .WorksheetName }}" -outputFilename '{{ .OutFilename }}' silent: false print: true - action: exec