From 38f10fcacdaaf4145a259204dcf07600bf3ff95d Mon Sep 17 00:00:00 2001 From: attila Date: Tue, 12 Dec 2023 13:12:54 +0100 Subject: [PATCH] Add more information about DynamicObject::writeAsJSON() to BREAKING_CHANGES.md --- BREAKING_CHANGES.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index 4e155a3a75..db611b4588 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -33,15 +33,25 @@ more extensible JSON::FormatOptions argument. **Possible Issues** -Code that overrides this function will fail to compile. +Code that overrides or calls this function will fail to compile. **Workaround** -Update the signatures of overriding functions. Use Formatter::getIndentLevel() -and Formatter::getMaxDecimalPlaces() as necessary. To find whether the output -should be multi-line, compare the result of Formatter::getSpacing() with +Update the signatures of overriding functions. Use FormatOptions::getIndentLevel() +and FormatOptions::getMaxDecimalPlaces() as necessary. To find whether the output +should be multi-line, compare the result of FormatOptions::getSpacing() with JSON::Spacing::multiLine. +Callers of the function can construct the new argument type using the old +arguments accordingly + +``` +JSON::FormatOptions{}.withIndentLevel (indentLevel) + .withSpacing (allOnOneLine ? JSON::Spacing::singleLine + : JSON::Spacing::multiLine) + .withMaxDecimalPlaces (maximumDecimalPlaces); +``` + **Rationale** The previous signature made it impossible to add new formatting options. Now,