mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
JSON: Add new JSON::Formatter for configuring JSON output
This also fixes an issue where MIDI CI header data could contain spaces, which is not allowed according to the spec.
This commit is contained in:
parent
06855ed05d
commit
224c4f706b
12 changed files with 203 additions and 96 deletions
|
|
@ -53,7 +53,7 @@ struct Encodings
|
|||
/** Converts a JSON object to a list of bytes in 7-bit ASCII format. */
|
||||
static std::vector<std::byte> jsonTo7BitText (const var& v)
|
||||
{
|
||||
return stringTo7BitText (JSON::toString (v, true));
|
||||
return stringTo7BitText (JSON::toString (v, JSON::FormatOptions{}.withSpacing (JSON::Spacing::none)));
|
||||
}
|
||||
|
||||
/** Each group of seven stored bytes is transmitted as eight bytes.
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ private:
|
|||
const auto json = ToVar::convert (body, opts);
|
||||
|
||||
if (json.has_value())
|
||||
*result = String (getDescription (body)) + ": " + JSON::toString (*json, true);
|
||||
*result = String (getDescription (body)) + ": " + JSON::toString (*json, JSON::FormatOptions{}.withSpacing (JSON::Spacing::none));
|
||||
}
|
||||
|
||||
const Message::Parsed* msg = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue