Browse Source

Add more information about DynamicObject::writeAsJSON() to BREAKING_CHANGES.md

develop
attila 1 year ago
parent
commit
38f10fcacd
1 changed files with 14 additions and 4 deletions
  1. +14
    -4
      BREAKING_CHANGES.md

+ 14
- 4
BREAKING_CHANGES.md View File

@@ -33,15 +33,25 @@ more extensible JSON::FormatOptions argument.


**Possible Issues** **Possible Issues**


Code that overrides this function will fail to compile.
Code that overrides or calls this function will fail to compile.


**Workaround** **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. 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** **Rationale**


The previous signature made it impossible to add new formatting options. Now, The previous signature made it impossible to add new formatting options. Now,


Loading…
Cancel
Save