diff --git a/build/app/restapi/embedded_spec.go b/build/app/restapi/embedded_spec.go index 69415d9..f10d451 100644 --- a/build/app/restapi/embedded_spec.go +++ b/build/app/restapi/embedded_spec.go @@ -138,7 +138,7 @@ func init() { "cmds": [ { "action": "foreach", - "exec": "/bin/json2excel -inputJson {{- if eq (deref .Item.Infile) \"\" }} \"input.json\" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName \"{{ .Item.Name }}\" -outputFilename '{{ .OutFilename }}'", + "exec": "/bin/json2excel -inputJson {{- if eq (deref .Item.Infile) \"\" }} \"input.json\" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName \"{{ .Item.Name }}\" -outputFilename '{{ .Body.OutFilename }}'", "loop": ".Sheets", "print": true, "silent": false @@ -302,7 +302,7 @@ func init() { "cmds": [ { "action": "foreach", - "exec": "/bin/json2excel -inputJson {{- if eq (deref .Item.Infile) \"\" }} \"input.json\" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName \"{{ .Item.Name }}\" -outputFilename '{{ .OutFilename }}'", + "exec": "/bin/json2excel -inputJson {{- if eq (deref .Item.Infile) \"\" }} \"input.json\" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName \"{{ .Item.Name }}\" -outputFilename '{{ .Body.OutFilename }}'", "loop": ".Sheets", "print": true, "silent": false diff --git a/build/app/restapi/operations/direktiv_post.go b/build/app/restapi/operations/direktiv_post.go index f3f2503..0b75a69 100644 --- a/build/app/restapi/operations/direktiv_post.go +++ b/build/app/restapi/operations/direktiv_post.go @@ -185,7 +185,7 @@ func runCommand0(ctx context.Context, params.DirektivDir, } - cmd, err := templateString(`/bin/json2excel -inputJson {{- if eq (deref .Item.Infile) "" }} "input.json" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName "{{ .Item.Name }}" -outputFilename '{{ .OutFilename }}'`, ls) + cmd, err := templateString(`/bin/json2excel -inputJson {{- if eq (deref .Item.Infile) "" }} "input.json" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName "{{ .Item.Name }}" -outputFilename '{{ .Body.OutFilename }}'`, ls) if err != nil { ir := make(map[string]interface{}) ir[successKey] = false diff --git a/swagger.yaml b/swagger.yaml index 32f5269..ba4d615 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -125,7 +125,8 @@ paths: - action: foreach loop: .Sheets #exec: /bin/json2excel -inputJson {{- if eq (deref .Infile) "" }} "input.json" {{- else }} {{ .Infile }} {{- end }} -worksheetName "{{ .WorksheetName }}" -outputFilename '{{ .OutFilename }}' - exec: /bin/json2excel -inputJson {{- if eq (deref .Item.Infile) "" }} "input.json" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName "{{ .Item.Name }}" -outputFilename '{{ .OutFilename }}' + exec: /bin/json2excel -inputJson {{- if eq (deref .Item.Infile) "" }} "input.json" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName "{{ .Item.Name }}" -outputFilename '{{ .Body.OutFilename }}' + #exec: ls -la /bin && echo "test" > {{ .Body.OutFilename }} silent: false print: true - action: exec diff --git a/tests/v1.0/tests.yaml b/tests/v1.0/tests.yaml index f10479e..ed91a59 100644 --- a/tests/v1.0/tests.yaml +++ b/tests/v1.0/tests.yaml @@ -9,19 +9,21 @@ states: action: function: export-xlsx input: - files: - - data: "jq(.input) \n" - name: input.json out-filename: example.xlsx - worksheet-name: TestSpreadsheet + sheets: + - input-file: + - data: jq(.input) + name: input.json + name: TestSpreadsheet transition: state1 - id: state1 type: action action: function: export-xlsx input: - files: - - data: "jq(.array | {input: . } | tostring ) \n" - name: input.json out-filename: example.xlsx - worksheet-name: TestSpreadsheet + sheets: + - input-file: + - data: 'jq(.array | {input: . } | tostring ) ' + name: input.json + name: TestSpreadsheet