Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

key list gives me a redundant JSON object #160

Open
stherold opened this issue Aug 30, 2024 · 3 comments
Open

key list gives me a redundant JSON object #160

stherold opened this issue Aug 30, 2024 · 3 comments

Comments

@stherold
Copy link

stherold commented Aug 30, 2024

Description

For some reason the following command:

lokalise2 --token "$LOKALISE_API_TOKEN" --project-id "$LOKALISE_PROJECT_ID" key list --filter-platforms ios --include-translations 1 --filter-translation-lang-ids "610,672,667,675,665,736,743,764,717,10168,10179,10180"

gives me a redundant JSON object at the end of the response which causes parsing trouble:

      "is_archived": false,
      "base_words": 3,
      "char_limit": 0,
      "modified_at": "2024-08-28 13:42:42 (Etc/UTC)",
      "modified_at_timestamp": 1724852562
    }
  ]
}
{
  "project_id": "384787975bd81c6599ccc3.30756087",
  "keys": []
}

My collegues do not have this issue for some reason.

Specs

Spec Value
lokalise2 version 3.0.1
Installation Method Homebrew (brew install lokalise/cli-2/lokalise2)
@stherold
Copy link
Author

This is most likely related to #138

@ledenis
Copy link

ledenis commented Feb 12, 2025

I have this issue as well with:

./bin/lokalise2 key list --project-id "$LOKALISE_PROJECT_ID" --token "$LOKALISE_API_TOKEN"
{
  "project_id": "[truncated]",
  "keys": [
    {
      [truncated]
    },
    {
      [truncated]
    }
  ]
}
{
  "project_id": "[truncated]",
  "keys": []
}

Also using lokalise2 version 3.0.1, installed via the Linux installer script

@ledenis
Copy link

ledenis commented Feb 12, 2025

Workaround: use | jq -n 'input' to take only the first JSON object and discard the extra JSON:

./bin/lokalise2 key list --project-id "$LOKALISE_PROJECT_ID" --token "$LOKALISE_API_TOKEN" | jq -n 'input'
{
  "project_id": "[truncated]",
  "keys": [
    {
      [truncated]
    },
    {
      [truncated]
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants