Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Serializer] Add support for seld/jsonlint#18678
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
javiereguiluz merged 1 commit intosymfony:6.4fromostrolucky:_Serializer]_Add_support_for_seld/jsonlintAug 3, 2023
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
22 changes: 22 additions & 0 deletionscomponents/serializer.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -999,6 +999,24 @@ context to pass in these options using the key ``json_encode_options`` or | ||
| $this->serializer->serialize($data, 'json', ['json_encode_options' => \JSON_PRESERVE_ZERO_FRACTION]); | ||
| These are the options available: | ||
| =============================== ===================================================== ================================ | ||
| Option Description Default | ||
| =============================== ===================================================== ================================ | ||
| ``json_decode_associative`` If set to true returns the result as an array, ``false`` | ||
| returns a nested ``stdClass`` hierarchy otherwise. ``false`` | ||
| ``json_decode_detailed_errors`` If set to true, exceptions thrown on parsing of JSON ``false`` | ||
| are more specific. Requires `seld/jsonlint`_ package. | ||
| ``json_encode_options`` `$flags`_ passed to `json_decode`_ function ``0`` | ||
| ``json_decode_options`` `$flags`_ passed to `json_encode`_ function ``\JSON_PRESERVE_ZERO_FRACTION`` | ||
| ``json_decode_recursion_depth`` Sets maximum recursion depth ``512`` | ||
| =============================== ===================================================== ================================ | ||
ostrolucky marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| .. versionadded:: 6.4 | ||
| The support of ``json_decode_detailed_errors`` was introduced in Symfony 6.4. | ||
| The ``CsvEncoder`` | ||
| ~~~~~~~~~~~~~~~~~~ | ||
| @@ -1828,3 +1846,7 @@ Learn more | ||
| .. _`RFC 4122`: https://tools.ietf.org/html/rfc4122 | ||
| .. _`PHP reflection`: https://php.net/manual/en/book.reflection.php | ||
| .. _`data URI`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | ||
| .. _seld/jsonlint: https://github.com/Seldaek/jsonlint | ||
| .. _json_decode: https://www.php.net/manual/en/function.json-decode.php | ||
| .. _json_encode: https://www.php.net/manual/en/function.json-encode.php | ||
| .. _$flags: https://www.php.net/manual/en/json.constants.php | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.