data-weave-cli
data-weave-cli copied to clipboard
NDJSON format not recognized
Describe the bug Format NDJSON is not recognized.
To Reproduce
- Installed with brew.
- Execute a transformation with input payload format
application/x-ndjson
$ dw run -i payload=in.ndjson "%dw 2.0 output application/json input payload application/x-ndjson --- payload"
[ERROR] Error while executing the script:
[ERROR] Unknown content type `application/x-ndjson`. Supported content types are: `application/dw`, `application/csv`, `application/json`, `multipart/form-data`, `application/octet-stream`, `text/x-java-properties`, `text/plain`, `application/x-www-form-urlencoded`, `application/xml`, `application/yaml`
1| %dw 2.0 output application/json input payload application/x-ndjson --- payload
^^^^^^^^^^^^^^^^^^^^
Trace:
at anonymous::main (line: 1, column: 50) at:
1| %dw 2.0 output application/json input payload application/x-ndjson --- payload
^^^^^^^^^^^^^^^^^^^^
Expected behavior The readme file indicates that the format is supported,.
Screenshots N/A
Desktop (please complete the following information):
- OS: macOS 13.3.1. Also happens in Windows.
dw --version
Command Line : V1.0.34
Runtime : V2.6.0-SNAPSHOT
Additional context Issue originally mentioned in Stackoverflow question: https://stackoverflow.com/questions/76292778/dataweave-in-windows-to-process-ndjson-files-x-ndjson-does-not-work
You can enable the ndjson module in the build.gradle file: 3f1d097e803ed7d33c8983f17843bbae049e2c7f