appbaseio / appbaseio/abc

import command doesn't throw error for invalid json

Open
#175 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
471
Forks
47
PR merge metrics
No merged PRs in 30d

Description

Currently, abc doesn't throw an error when we have an invalid JSON file, rather it succeeds with 0 records inserted.

## How to replicate
* Create an invalid JSON file. Here file has extra `,`

```
echo '[
{
"name": "jame",
"email": "jame@yopmail.com",
}
]' > test1.json
```
* Try abc command
`abc import --src_type=json --src_uri=test1.json --log.level=debug http://admin:admin@localhost:9200/test`

* `abc` version used here: `1.0.0 Preview Release 2`

## Expected output

Command should throw an error with correct exit status, if the command fails

Contributor guide

Open the contributing guide

Research direction

Start with the `abc import` command and its JSON input handling, using the reproduction command and invalid `test1.json` shown in the issue. Verify that malformed JSON produces an error and a nonzero exit status instead of reporting zero records inserted.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, json
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.