Skip to content

[Serializer] [JsonStreamer] Add streaming JSON documentation #20486

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

Open
wants to merge 1 commit into
base: 7.3
Choose a base branch
from

Conversation

mtarld
Copy link
Contributor

@mtarld mtarld commented Dec 19, 2024

@carsonbot carsonbot added this to the 7.3 milestone Dec 19, 2024
@mtarld mtarld force-pushed the feat/json-encoder branch 2 times, most recently from 592f9aa to afa08c8 Compare December 20, 2024 15:41
@mtarld
Copy link
Contributor Author

mtarld commented Dec 20, 2024

The remaining failure is due to the fact that the https://github.com/symfony-tools/symfony-application application does not have the src/Encodable folder.

Should we create it? Or should we add the issue to the baseline? Or maybe commenting that configuration?

@wouterj
Copy link
Member

wouterj commented Dec 21, 2024

Hi @mtarld. Thanks a lot for starting this and providing so much valuable documentation early in the development phase!

Before reviewing the whole document, we must think about the position of the component in the documentation. We've mostly stopped using the components/ directory. Instead, we focus on the "guides" and document framework usage. This component is a bit more challenging, as it belongs to the "Serialization" topic that currently belongs to the Serializer component. We've discussed this a bit with the core team during the SymfonyCon:

I think the best way would be to move this article to serializer/json_encoder.rst, and add a little section at the start of serializer.rst mentioning this component and when you should use instead of the Serializer component (e.g. a compact version of the "Serializer or JsonEncoder?" section). But we're of course open if people have better ideas on how to position this new component in the ecosystem!


Something that might also be interesting is adding a php-standalone tab to some of the code examples, showing how to use this component standalone. You can see this in use in the main serializer.rst for instance.

@SirRFI
Copy link
Contributor

SirRFI commented Apr 23, 2025

The documentation requires update, because the component and it's contents has been renamed - see symfony/symfony#59863

@SirRFI
Copy link
Contributor

SirRFI commented Apr 23, 2025

Can you provide minimum code required to use the component in custom service inside Symfony project? Could be also useful for "New in Symfony 7.3" blog series.

I tried following the documentation (with updated names), but I get Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "Symfony\Component\JsonStreamer\StreamReaderInterface". despite it's visible in bin/console debug:container. Also tried json.stream_reader alias. All Symfony dependencies are updated to 7.3.*-dev.

@mtarld
Copy link
Contributor Author

mtarld commented Apr 23, 2025

Hey @SirRFI , thanks for keeping track of it. I'm aware of these points yes! 🙂

I'm really busy these days, but as soon as I have time, I'll update this PR (containing your suggestions) - it's part of my top priorities.

@mtarld mtarld force-pushed the feat/json-encoder branch from afa08c8 to 749bd5d Compare April 27, 2025 08:37
@mtarld mtarld changed the title [JsonEncoder] Add component documentation [Serializer] [JsonStreamer] Add streaming JSON documentation Apr 27, 2025
@mtarld mtarld force-pushed the feat/json-encoder branch from 749bd5d to 0e63875 Compare April 27, 2025 08:40
@mtarld mtarld force-pushed the feat/json-encoder branch from 0e63875 to fb3e6c6 Compare April 27, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Serializer] [JsonEncoder] Introducing the component
6 participants