Skip to content

Fixes to Content Negotiation / Serialization docs #1357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion core/content-negotiation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The API system has built-in [content negotiation](https://en.wikipedia.org/wiki/Content_negotiation) capabilities.

By default, only the [JSON-LD](https://json-ld.org) format is enabled. However API Platform Core supports many more formats and can be extended.
By default, only the [JSON-LD](https://json-ld.org) and JSON formats are enabled. However API Platform Core supports many more formats and can be extended.

The framework natively supports JSON-LD (and Hydra), GraphQL, JSON:API, HAL, YAML, CSV, HTML (API docs), raw JSON and raw XML.
Using the raw JSON or raw XML formats is discouraged, prefer using JSON-LD instead, which provides more feature and is as easy to use.
Expand Down Expand Up @@ -52,6 +52,7 @@ api_platform:
yaml: ['application/x-yaml']
csv: ['text/csv']
html: ['text/html']
myformat: ['application/vnd.myformat']
```

To enable GraphQL support, [read the dedicated chapter](graphql.md).
Expand Down
4 changes: 3 additions & 1 deletion core/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,9 @@ services:
Note: this normalizer will work only for JSON-LD format, if you want to process JSON data too, you have to decorate another service:

```yaml
App\Serializer\ApiNormalizer:
# Need a different name to avoid duplicate YAML key
'app.serializer.normalizer.item.json':
class: 'App\Serializer\ApiNormalizer'
decorates: 'api_platform.serializer.normalizer.item'
```

Expand Down