quixio / quix-cli

9 stars 1 forks source link

`quix library list --output json` contains invalid multiline strings. #12

Closed krisajenkins closed 5 months ago

krisajenkins commented 6 months ago

I think the --output json flag is accidentally word-wrapping the results. When I call quix library list --output json I get newlines in shortDescription:

[
  {
    "itemId": "9514c27e-c924-4d3b-ab47-9ecfe6570293",
    "name": "Kafka Connect Source",
    "language": "Python",
    "tags": [
      "Advanced",
      "Source",
      "Connectors",
      "Kafka"
    ],
    "shortDescription": "Publish a Kafka Connect source connector to Quix
platform",
    "createdAt": "2024-01-31T17:00:35+00:00",
    "updatedAt": "2024-02-20T09:13:01+00:00",
    "iconFile": "icon.png",
    "deployReady": true,
    "deployable": true
  },
  {
    "itemId": "9514c27e-c924-4d3b-ab47-9ecfe6570294",
    "name": "Kafka Connect Sink",
    "language": "Python",
    "tags": [
      "Advanced",
      "Destination",
      "Connectors",
      "Kafka"
    ],
    "shortDescription": "Publish a Kafka Connect sink connector to Quix
platform",
    "createdAt": "2024-01-31T17:00:35+00:00",
    "updatedAt": "2024-02-20T09:13:01+00:00",
    "iconFile": "icon.png",
    "deployReady": true,
    "deployable": true
  },
  ...

Those newlines aren't valid JSON, so if I try to process the output this happens:

$ quix library list --output json | jq .
jq: parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 13, column 9
krisajenkins commented 6 months ago

(I should add, I'm only discovering these bugs because I'm finding quix-cli so useful. Thanks for working on it! 🙂)

luisquix commented 5 months ago

Sorry for the late response, this has been already fixed in the latest release.

Thanks for your feedback!