A string with a NUL in it gets written, but the library can't read the file back:
var project = try XCSchema.Project(jsonRepresentation: Data(#"{"default-configuration":"Debug","localizations":{"development":"en"},"files":[]}"#.utf8))
project.buildSettings["FOO"] = .string("a\u{0}b")
let data = try project.jsonRepresentation() // succeeds
_ = try XCSchema.Project(jsonRepresentation: data) // throws "The data couldn't be read because it isn't in the correct format."
The writer escapes the NUL as a JSON unicode escape. The reader uses JSONSerialization with .json5Allowed, and Foundation's JSON5 scanner rejects escaped nulls ("Unsupported escaped null"), though plain JSON mode accepts them. Any string field hits this.
If NUL isn't meant to be allowed, jsonRepresentation() should throw instead of writing the file.
main @ c132630, macOS 26, Swift 6.3.3
A string with a NUL in it gets written, but the library can't read the file back:
The writer escapes the NUL as a JSON unicode escape. The reader uses
JSONSerializationwith.json5Allowed, and Foundation's JSON5 scanner rejects escaped nulls ("Unsupported escaped null"), though plain JSON mode accepts them. Any string field hits this.If NUL isn't meant to be allowed,
jsonRepresentation()should throw instead of writing the file.main @ c132630, macOS 26, Swift 6.3.3