# werkzeug.exceptions.BadRequest: 400 Bad Request: Failed to decode JSON object: Expecting value: line 1 column 1 (char 0)

- **ID:** `python/flask-json-request-invalid`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The request body is not valid JSON when Flask tries to parse it via request.get_json().

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   Validate first: if request.is_json: data = request.get_json() else: return {'error': 'Invalid JSON'}, 400
   ```
2. **** (90% success)
   ```
   Use request.get_json(silent=True) which returns None on error and handle it
   ```

## Dead Ends

- **** — Still raises JSONDecodeError if the body is invalid. (70% fail)
- **** — This doesn't help the client fix their request; they need to send valid JSON. (40% fail)
