influxdata / influxdata/influxdb

JSON decode error deleting an organization when its id is missing from a request.

Open
#18,665 0 comments 0 reactions 0 assignees View on GitHub
kind/bug regression team/compute
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

Response error json object should always return `error code` and `error message` in case of the error.
When organization id (required) is missing from `delete` organization request then response.json() is returning `JSONDecodeError`

__Repro__:
- Delete request:
```
base_url=http://localhost:9999
path=/api/v2/orgs/
auth=None
headers={'Authorization': 'Token Ndm22KCx8Te05YD3UsoA2_HOQeagonlRM6zOWureORyGTEpKkcYpbWiR9BZvvCm8_Pp4FTyZLJCntKzdgJ1aqg=='}
timeout=None
verify=False
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the DELETE request against /api/v2/orgs/ with the organization id omitted, then trace the API handling for that route and its JSON error response. Done means the missing required id produces a decodable JSON response containing both an error code and an error message.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.