-
Notifications
You must be signed in to change notification settings - Fork 111
Closed
Description
Dart SDK version: 3.0.4 (stable) (Wed Jun 7 14:55:32 2023 +0000) on "windows_x64"
I'm using a custom builder to generate JSON from some annotations used in another program. You can think of it like Protobuf. This is working fine but I was surprised that using a header value of an empty string still produced the auto-generated message in the output .json
file, which is not compliant to the .json
spec. My work-around at the moment is just to trim the file contents after the last line but it seems counter-intuitive to have to do this at all.
Example:
Builder yarnJsonBuilder(BuilderOptions options) => LibraryBuilder(
YarnGenerator(),
generatedExtension: '.yarn.json',
formatOutput: (code) => code
.split(
r'// **************************************************************************')
.last
.trim(),
header: '');
// ...
Metadata
Metadata
Assignees
Labels
No labels