JSON Trouble
Explore how to identify and fix JSON encoding issues when building pure functional HTTP APIs in Scala. Understand the use of streaming libraries, such as fs2, and techniques like interspersing elements in streams to produce valid JSON output. This lesson helps you develop a deeper understanding of handling data serialization cleanly within a purely functional programming approach.
We'll cover the following...
We'll cover the following...
Broken JSON
Now that we have a proper streaming solution, we can try it out.
What do we get when we expect a list of products?
The
httpcommand is from the tool httpie19 for querying our service.
Well, whatever this is, it is not JSON! It might look like it, but it isn’t. However, quite often such things ...