Support JSONAPI `application/vnd.api+json` media type
- Dominant language
- Python
- Stars
- 11.1k
- Forks
- 1k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 2
Description
The **[JSON API specification](https://jsonapi.org)** uses `application/vnd.api+json` as its designated media type. This should work just like `application/json`, but Chalice will not parse the request's JSON payload into a Python object:
```python
@app.route("/someroute", methods=["POST"], content_types=["application/vnd.api+json"])
def someroute():
request = app.current_request
assert request.json_body is not None # Fails
```
Maybe we could keep a list for JSON related media types, just like `app.api.binary_types`?
Contributor guide
Research direction
Start by tracing how request.json_body handles content_types and compare that behavior with app.api.binary_types. Add coverage for application/vnd.api+json alongside application/json, and verify the example route receives a parsed Python object for that media type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100