import command doesn't throw error for invalid json
- 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
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