From f8c8528c123854a96c7c5c2eb0c86bb162653df6 Mon Sep 17 00:00:00 2001
From: IOL0ol1 <1353839731@qq.com>
Date: Thu, 19 Nov 2026 19:32:44 +0800
Subject: [PATCH 1/2] refactor: write the OME-Zarr metadata with
System.Text.Json
Replace the hand-written JsonText writer with Utf8JsonWriter. The documents
keep their members and order, and the relaxed encoder leaves characters such
as < > & ' + and most non-ASCII text unescaped, as before. Some characters in
the image name are now written as \u escapes: those outside the BMP, DEL and
C1 controls, and format, separator, private-use and unassigned code points;
\u escapes now use upper-case hex digits.
On .NET 10 numbers are written as before. On .NET Framework, System.Text.Json
writes non-integers with 17 significant digits (0.242 as 0.24199999999999999),
which parse to the same values.
The netstandard2.0 and netstandard2.1 builds now depend on the
System.Text.Json package; net10.0 uses the shared framework's copy.
---
Directory.Packages.props | 1 +
eng/Test-Packages.ps1 | 4 +-
src/OpenSlideSharp/Internal/JsonText.cs | 158 -----------
src/OpenSlideSharp/OmeZarrGenerator.cs | 311 ++++++++++++++--------
src/OpenSlideSharp/OpenSlideSharp.csproj | 5 +
test/OpenSlideSharp.Tests/OmeZarrTests.cs | 7 +-
6 files changed, 214 insertions(+), 272 deletions(-)
delete mode 100644 src/OpenSlideSharp/Internal/JsonText.cs
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 54bc149..e420028 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -6,6 +6,7 @@
+
diff --git a/eng/Test-Packages.ps1 b/eng/Test-Packages.ps1
index 337b1bf..c866009 100644
--- a/eng/Test-Packages.ps1
+++ b/eng/Test-Packages.ps1
@@ -201,8 +201,8 @@ foreach ($pv in ([xml](Get-Content (Join-Path $root 'Directory.Packages.props')
$coreMeta = (Get-NuspecXml (Join-Path $feed "OpenSlideSharp.$Version.nupkg")).package.metadata
Assert-DependencyGroups 'core' $coreMeta @{
'net10.0' = @{}
- '.NETStandard2.0' = @{ 'System.Memory' = $central['System.Memory'] }
- '.NETStandard2.1' = @{}
+ '.NETStandard2.0' = @{ 'System.Memory' = $central['System.Memory']; 'System.Text.Json' = $central['System.Text.Json'] }
+ '.NETStandard2.1' = @{ 'System.Text.Json' = $central['System.Text.Json'] }
}
$skiaMeta = (Get-NuspecXml (Join-Path $feed "OpenSlideSharp.SkiaSharp.$Version.nupkg")).package.metadata
diff --git a/src/OpenSlideSharp/Internal/JsonText.cs b/src/OpenSlideSharp/Internal/JsonText.cs
deleted file mode 100644
index 8ec9b6f..0000000
--- a/src/OpenSlideSharp/Internal/JsonText.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-using System;
-using System.Globalization;
-using System.Text;
-
-namespace OpenSlideSharp;
-
-///
-/// A minimal writer for compact JSON (no whitespace), so the core package needs no JSON library. It inserts the
-/// commas between values but does not check that the calls form a well-nested document; callers write the
-/// structure they mean. Strings are escaped as RFC 8259 requires; other characters are written as they are.
-///
-internal sealed class JsonText
-{
- private readonly StringBuilder _text = new();
- private bool _afterValue; // a value (or a closed container) was just written, so the next one needs a comma
-
- internal JsonText StartObject() => Open('{');
-
- internal JsonText EndObject() => Close('}');
-
- internal JsonText StartArray() => Open('[');
-
- internal JsonText EndArray() => Close(']');
-
- /// Writes a property name and the colon; the next call writes its value.
- internal JsonText Name(string name)
- {
- Separate();
- AppendString(name);
- _text.Append(':');
- _afterValue = false;
- return this;
- }
-
- internal JsonText Value(string value)
- {
- Separate();
- AppendString(value);
- _afterValue = true;
- return this;
- }
-
- internal JsonText Value(long value) => Raw(value.ToString(CultureInfo.InvariantCulture));
-
- /// Writes a finite number with the round-trip ("R") invariant format.
- /// is NaN or infinite, which JSON cannot represent.
- internal JsonText Value(double value)
- {
- if (double.IsNaN(value) || double.IsInfinity(value))
- {
- throw new ArgumentOutOfRangeException(nameof(value), value, "JSON numbers must be finite.");
- }
-
- return Raw(value.ToString("R", CultureInfo.InvariantCulture));
- }
-
- internal JsonText Value(bool value) => Raw(value ? "true" : "false");
-
- internal JsonText Null() => Raw("null");
-
- internal JsonText Property(string name, string value) => Name(name).Value(value);
-
- internal JsonText Property(string name, long value) => Name(name).Value(value);
-
- internal JsonText Property(string name, bool value) => Name(name).Value(value);
-
- /// Writes an array of integers.
- internal JsonText Numbers(params long[] values)
- {
- StartArray();
- foreach (long value in values)
- {
- Value(value);
- }
-
- return EndArray();
- }
-
- /// Writes an array of finite numbers.
- internal JsonText Numbers(params double[] values)
- {
- StartArray();
- foreach (double value in values)
- {
- Value(value);
- }
-
- return EndArray();
- }
-
- /// Returns the text written so far.
- public override string ToString() => _text.ToString();
-
- /// Returns the text written so far, encoded as UTF-8 without a byte order mark.
- internal byte[] ToUtf8() => Encoding.UTF8.GetBytes(_text.ToString());
-
- private JsonText Open(char bracket)
- {
- Separate();
- _text.Append(bracket);
- _afterValue = false;
- return this;
- }
-
- private JsonText Close(char bracket)
- {
- _text.Append(bracket);
- _afterValue = true;
- return this;
- }
-
- private JsonText Raw(string token)
- {
- Separate();
- _text.Append(token);
- _afterValue = true;
- return this;
- }
-
- private void Separate()
- {
- if (_afterValue)
- {
- _text.Append(',');
- }
- }
-
- private void AppendString(string value)
- {
- _text.Append('"');
- foreach (char c in value)
- {
- switch (c)
- {
- case '"': _text.Append("\\\""); break;
- case '\\': _text.Append("\\\\"); break;
- case '\b': _text.Append("\\b"); break;
- case '\f': _text.Append("\\f"); break;
- case '\n': _text.Append("\\n"); break;
- case '\r': _text.Append("\\r"); break;
- case '\t': _text.Append("\\t"); break;
- default:
- if (c < ' ')
- {
- _text.Append("\\u").Append(((int)c).ToString("x4", CultureInfo.InvariantCulture));
- }
- else
- {
- _text.Append(c);
- }
-
- break;
- }
- }
-
- _text.Append('"');
- }
-}
diff --git a/src/OpenSlideSharp/OmeZarrGenerator.cs b/src/OpenSlideSharp/OmeZarrGenerator.cs
index c93d54a..0a58420 100644
--- a/src/OpenSlideSharp/OmeZarrGenerator.cs
+++ b/src/OpenSlideSharp/OmeZarrGenerator.cs
@@ -4,6 +4,8 @@
using System.Globalization;
using System.IO;
using System.IO.Compression;
+using System.Text.Encodings.Web;
+using System.Text.Json;
using System.Threading;
namespace OpenSlideSharp;
@@ -197,6 +199,11 @@ public sealed class OmeZarrGenerator
{
private const int ChannelCount = 3;
+ // Compact metadata. The documents are JSON files, never embedded in HTML, so the relaxed encoder leaves characters
+ // such as < > & ' + and most non-ASCII text as they are; it still escapes control characters, characters outside
+ // the BMP and a few other categories.
+ private static readonly JsonWriterOptions JsonOptions = new() { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping };
+
private readonly IRenderSource _source;
private readonly Action? _ensureUsable;
private readonly RegionRenderer _renderer;
@@ -557,91 +564,127 @@ private byte[] RenderRegion(RegionKey key)
{
var keys = new List();
var content = new Dictionary(StringComparer.Ordinal);
- void Add(string key, JsonText json)
+ void Add(string key, Action write)
{
keys.Add(key);
- content.Add(key, json.ToUtf8());
+ content.Add(key, WriteJson(write));
}
if (Version == NgffVersion.V0_5)
{
- var group = new JsonText().StartObject()
- .Property("zarr_format", 3)
- .Property("node_type", "group")
- .Name("attributes").StartObject()
- .Name("ome").StartObject()
- .Property("version", "0.5");
- WriteImageAttributes(group, null, name, geometry);
- Add("zarr.json", group.EndObject().EndObject().EndObject());
+ Add("zarr.json", json =>
+ {
+ json.WriteStartObject();
+ json.WriteNumber("zarr_format", 3);
+ json.WriteString("node_type", "group");
+ json.WriteStartObject("attributes");
+ json.WriteStartObject("ome");
+ json.WriteString("version", "0.5");
+ WriteImageAttributes(json, null, name, geometry);
+ json.WriteEndObject();
+ json.WriteEndObject();
+ json.WriteEndObject();
+ });
for (int level = 0; level < LevelCount; level++)
{
SlideSize size = _levelDimensions[level];
- var array = new JsonText().StartObject()
- .Property("zarr_format", 3)
- .Property("node_type", "array")
- .Name("shape").Numbers(ChannelCount, size.Height, size.Width)
- .Property("data_type", "uint8")
- .Name("chunk_grid").StartObject()
- .Property("name", "regular")
- .Name("configuration").StartObject().Name("chunk_shape").Numbers(1, ChunkSize, ChunkSize).EndObject()
- .EndObject()
- .Name("chunk_key_encoding").StartObject()
- .Property("name", "default")
- .Name("configuration").StartObject().Property("separator", "/").EndObject()
- .EndObject()
- .Property("fill_value", 0)
- .Name("codecs").StartArray()
- .StartObject()
- .Property("name", "bytes")
- .Name("configuration").StartObject().Property("endian", "little").EndObject()
- .EndObject();
- if (_compression == OmeZarrCompression.Gzip)
+ Add(Invariant(level) + "/zarr.json", json =>
{
- array.StartObject()
- .Property("name", "gzip")
- .Name("configuration").StartObject().Property("level", _gzipLevel).EndObject()
- .EndObject();
- }
+ json.WriteStartObject();
+ json.WriteNumber("zarr_format", 3);
+ json.WriteString("node_type", "array");
+ WriteNumbers(json, "shape", ChannelCount, size.Height, size.Width);
+ json.WriteString("data_type", "uint8");
+
+ json.WriteStartObject("chunk_grid");
+ json.WriteString("name", "regular");
+ json.WriteStartObject("configuration");
+ WriteNumbers(json, "chunk_shape", 1, ChunkSize, ChunkSize);
+ json.WriteEndObject();
+ json.WriteEndObject();
+
+ json.WriteStartObject("chunk_key_encoding");
+ json.WriteString("name", "default");
+ json.WriteStartObject("configuration");
+ json.WriteString("separator", "/");
+ json.WriteEndObject();
+ json.WriteEndObject();
+
+ json.WriteNumber("fill_value", 0);
+
+ json.WriteStartArray("codecs");
+ json.WriteStartObject();
+ json.WriteString("name", "bytes");
+ json.WriteStartObject("configuration");
+ json.WriteString("endian", "little");
+ json.WriteEndObject();
+ json.WriteEndObject();
+ if (_compression == OmeZarrCompression.Gzip)
+ {
+ json.WriteStartObject();
+ json.WriteString("name", "gzip");
+ json.WriteStartObject("configuration");
+ json.WriteNumber("level", _gzipLevel);
+ json.WriteEndObject();
+ json.WriteEndObject();
+ }
- array.EndArray()
- .Name("dimension_names").StartArray().Value("c").Value("y").Value("x").EndArray()
- .EndObject();
- Add(Invariant(level) + "/zarr.json", array);
+ json.WriteEndArray();
+
+ json.WriteStartArray("dimension_names");
+ json.WriteStringValue("c");
+ json.WriteStringValue("y");
+ json.WriteStringValue("x");
+ json.WriteEndArray();
+ json.WriteEndObject();
+ });
}
}
else
{
- Add(".zgroup", new JsonText().StartObject().Property("zarr_format", 2).EndObject());
+ Add(".zgroup", json =>
+ {
+ json.WriteStartObject();
+ json.WriteNumber("zarr_format", 2);
+ json.WriteEndObject();
+ });
- var attributes = new JsonText().StartObject();
- WriteImageAttributes(attributes, "0.4", name, geometry);
- Add(".zattrs", attributes.EndObject());
+ Add(".zattrs", json =>
+ {
+ json.WriteStartObject();
+ WriteImageAttributes(json, "0.4", name, geometry);
+ json.WriteEndObject();
+ });
for (int level = 0; level < LevelCount; level++)
{
SlideSize size = _levelDimensions[level];
- var array = new JsonText().StartObject()
- .Name("chunks").Numbers(1, ChunkSize, ChunkSize)
- .Name("compressor");
- if (_compression == OmeZarrCompression.Gzip)
+ Add(Invariant(level) + "/.zarray", json =>
{
- array.StartObject().Property("id", "gzip").Property("level", _gzipLevel).EndObject();
- }
- else
- {
- array.Null();
- }
+ json.WriteStartObject();
+ WriteNumbers(json, "chunks", 1, ChunkSize, ChunkSize);
+ if (_compression == OmeZarrCompression.Gzip)
+ {
+ json.WriteStartObject("compressor");
+ json.WriteString("id", "gzip");
+ json.WriteNumber("level", _gzipLevel);
+ json.WriteEndObject();
+ }
+ else
+ {
+ json.WriteNull("compressor");
+ }
- array.Property("dimension_separator", "/")
- .Property("dtype", "|u1")
- .Property("fill_value", 0)
- .Name("filters").Null()
- .Property("order", "C")
- .Name("shape").Numbers(ChannelCount, size.Height, size.Width)
- .Property("zarr_format", 2)
- .EndObject();
- Add(Invariant(level) + "/.zarray", array);
+ json.WriteString("dimension_separator", "/");
+ json.WriteString("dtype", "|u1");
+ json.WriteNumber("fill_value", 0);
+ json.WriteNull("filters");
+ json.WriteString("order", "C");
+ WriteNumbers(json, "shape", ChannelCount, size.Height, size.Width);
+ json.WriteNumber("zarr_format", 2);
+ json.WriteEndObject();
+ });
}
}
@@ -650,9 +693,10 @@ void Add(string key, JsonText json)
// Writes the "multiscales" and "omero" members of the image attributes; version is the 0.4 per-multiscale
// version, or null for 0.5, which keeps it next to them instead.
- private void WriteImageAttributes(JsonText json, string? version, string name, SlideGeometry geometry)
+ private void WriteImageAttributes(Utf8JsonWriter json, string? version, string name, SlideGeometry geometry)
{
- // Micrometers need both mpp values, and every number they give must be finite; otherwise level 0 pixels.
+ // Micrometers need both mpp values, and every number they give must be finite (JSON has no NaN or infinity,
+ // and the writer throws on them); otherwise level 0 pixels.
double pixelX = 1;
double pixelY = 1;
bool micrometers = false;
@@ -668,77 +712,126 @@ private void WriteImageAttributes(JsonText json, string? version, string name, S
}
}
- json.Name("multiscales").StartArray().StartObject();
+ json.WriteStartArray("multiscales");
+ json.WriteStartObject();
if (version is not null)
{
- json.Property("version", version);
+ json.WriteString("version", version);
}
- json.Property("name", name)
- .Property("type", "lanczos")
- .Name("metadata").StartObject()
- .Property("method", "OpenSlideSharp")
- .Property("description", "Rendered from OpenSlide levels with Lanczos-3 resampling")
- .EndObject();
+ json.WriteString("name", name);
+ json.WriteString("type", "lanczos");
+ json.WriteStartObject("metadata");
+ json.WriteString("method", "OpenSlideSharp");
+ json.WriteString("description", "Rendered from OpenSlide levels with Lanczos-3 resampling");
+ json.WriteEndObject();
- json.Name("axes").StartArray()
- .StartObject().Property("name", "c").Property("type", "channel").EndObject();
+ json.WriteStartArray("axes");
+ json.WriteStartObject();
+ json.WriteString("name", "c");
+ json.WriteString("type", "channel");
+ json.WriteEndObject();
foreach (string axis in new[] { "y", "x" })
{
- json.StartObject().Property("name", axis).Property("type", "space");
+ json.WriteStartObject();
+ json.WriteString("name", axis);
+ json.WriteString("type", "space");
if (micrometers)
{
- json.Property("unit", "micrometer");
+ json.WriteString("unit", "micrometer");
}
- json.EndObject();
+ json.WriteEndObject();
}
- json.EndArray();
+ json.WriteEndArray();
- json.Name("datasets").StartArray();
+ json.WriteStartArray("datasets");
double downsample = 1; // 2^level, exact
for (int level = 0; level < LevelCount; level++, downsample *= 2)
{
- json.StartObject()
- .Property("path", Invariant(level))
- .Name("coordinateTransformations").StartArray()
- .StartObject()
- .Property("type", "scale")
- .Name("scale").Numbers(1.0, pixelY * downsample, pixelX * downsample)
- .EndObject();
+ json.WriteStartObject();
+ json.WriteString("path", Invariant(level));
+ json.WriteStartArray("coordinateTransformations");
+ json.WriteStartObject();
+ json.WriteString("type", "scale");
+ WriteNumbers(json, "scale", 1.0, pixelY * downsample, pixelX * downsample);
+ json.WriteEndObject();
if (_limitBounds)
{
- json.StartObject()
- .Property("type", "translation")
- .Name("translation").Numbers(0.0, geometry.OffsetY * pixelY, geometry.OffsetX * pixelX)
- .EndObject();
+ json.WriteStartObject();
+ json.WriteString("type", "translation");
+ WriteNumbers(json, "translation", 0.0, geometry.OffsetY * pixelY, geometry.OffsetX * pixelX);
+ json.WriteEndObject();
}
- json.EndArray().EndObject();
+ json.WriteEndArray();
+ json.WriteEndObject();
}
- json.EndArray().EndObject().EndArray();
+ json.WriteEndArray();
+ json.WriteEndObject();
+ json.WriteEndArray();
- json.Name("omero").StartObject().Name("channels").StartArray();
+ json.WriteStartObject("omero");
+ json.WriteStartArray("channels");
foreach ((string label, string color) in new[] { ("Red", "FF0000"), ("Green", "00FF00"), ("Blue", "0000FF") })
{
- json.StartObject()
- .Property("label", label)
- .Property("color", color)
- .Name("window").StartObject()
- .Property("start", 0).Property("end", 255).Property("min", 0).Property("max", 255)
- .EndObject()
- .Property("active", true)
- .Property("coefficient", 1)
- .Property("family", "linear")
- .Property("inverted", false)
- .EndObject();
- }
-
- json.EndArray()
- .Name("rdefs").StartObject().Property("model", "color").EndObject()
- .EndObject();
+ json.WriteStartObject();
+ json.WriteString("label", label);
+ json.WriteString("color", color);
+ json.WriteStartObject("window");
+ json.WriteNumber("start", 0);
+ json.WriteNumber("end", 255);
+ json.WriteNumber("min", 0);
+ json.WriteNumber("max", 255);
+ json.WriteEndObject();
+ json.WriteBoolean("active", true);
+ json.WriteNumber("coefficient", 1);
+ json.WriteString("family", "linear");
+ json.WriteBoolean("inverted", false);
+ json.WriteEndObject();
+ }
+
+ json.WriteEndArray();
+ json.WriteStartObject("rdefs");
+ json.WriteString("model", "color");
+ json.WriteEndObject();
+ json.WriteEndObject();
+ }
+
+ // One document, as UTF-8 without a byte order mark.
+ private static byte[] WriteJson(Action write)
+ {
+ using var stream = new MemoryStream();
+ using (var json = new Utf8JsonWriter(stream, JsonOptions))
+ {
+ write(json);
+ }
+
+ return stream.ToArray();
+ }
+
+ private static void WriteNumbers(Utf8JsonWriter json, string name, params long[] values)
+ {
+ json.WriteStartArray(name);
+ foreach (long value in values)
+ {
+ json.WriteNumberValue(value);
+ }
+
+ json.WriteEndArray();
+ }
+
+ private static void WriteNumbers(Utf8JsonWriter json, string name, params double[] values)
+ {
+ json.WriteStartArray(name);
+ foreach (double value in values)
+ {
+ json.WriteNumberValue(value);
+ }
+
+ json.WriteEndArray();
}
private static bool IsFinite(double value) => !double.IsNaN(value) && !double.IsInfinity(value);
diff --git a/src/OpenSlideSharp/OpenSlideSharp.csproj b/src/OpenSlideSharp/OpenSlideSharp.csproj
index 17cc673..58b1466 100644
--- a/src/OpenSlideSharp/OpenSlideSharp.csproj
+++ b/src/OpenSlideSharp/OpenSlideSharp.csproj
@@ -17,4 +17,9 @@
+
+
+
+
+
diff --git a/test/OpenSlideSharp.Tests/OmeZarrTests.cs b/test/OpenSlideSharp.Tests/OmeZarrTests.cs
index 4fb0364..d104fb7 100644
--- a/test/OpenSlideSharp.Tests/OmeZarrTests.cs
+++ b/test/OpenSlideSharp.Tests/OmeZarrTests.cs
@@ -315,11 +315,12 @@ public void Metadata_InvalidMpp_UsesPixelUnits()
[Fact]
public void Metadata_EscapesName()
{
+ // The documents are JSON files, not HTML: non-ASCII text and characters such as < > & ' + stay as they are.
var generator = new OmeZarrGenerator(
- FakeRenderSource.SingleLevel(10, 10), "a\"b\\c\u0001\n\t\u00e9", false, Options());
+ FakeRenderSource.SingleLevel(10, 10), "a\"b\\c\u0001\n\t\u00e9<>&'+", false, Options());
- Assert.Equal("a\"b\\c\u0001\n\t\u00e9", Multiscale(generator).GetProperty("name").GetString());
- Assert.Contains("\"name\":\"a\\\"b\\\\c\\u0001\\n\\t\u00e9\"", EntryText(generator, "zarr.json"));
+ Assert.Equal("a\"b\\c\u0001\n\t\u00e9<>&'+", Multiscale(generator).GetProperty("name").GetString());
+ Assert.Contains("\"name\":\"a\\\"b\\\\c\\u0001\\n\\t\u00e9<>&'+\"", EntryText(generator, "zarr.json"));
}
// ---- array metadata -------------------------------------------------------------------------------------
From 4e7e4f3565d033d3b46849398c859c92ca7beaf5 Mon Sep 17 00:00:00 2001
From: IOL0ol1 <1353839731@qq.com>
Date: Thu, 19 Nov 2026 19:33:00 +0800
Subject: [PATCH 2/2] test: read zarr.json in the package smoke tests
The .NET Framework smoke apps load the netstandard2.0 core with the
System.Text.Json package, so a dependency that fails to load now fails them.
---
eng/Test-Packages.ps1 | 1 +
test/PackageSmoke/Program.cs | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/eng/Test-Packages.ps1 b/eng/Test-Packages.ps1
index c866009..4240005 100644
--- a/eng/Test-Packages.ps1
+++ b/eng/Test-Packages.ps1
@@ -374,6 +374,7 @@ function Invoke-Smoke {
if ($code -ne $ExpectedExit) { throw "[$Name] expected exit code $ExpectedExit, got $code" }
if ($text -notmatch [regex]::Escape($ExpectedText)) { throw "[$Name] output does not contain '$ExpectedText'" }
if ($ExpectedExit -eq 0 -and $text -notmatch 'png=ok') { throw "[$Name] output does not contain 'png=ok'" }
+ if ($ExpectedExit -eq 0 -and $text -notmatch 'zarr=ok') { throw "[$Name] output does not contain 'zarr=ok'" }
Write-Host "PASS: $Name"
}
diff --git a/test/PackageSmoke/Program.cs b/test/PackageSmoke/Program.cs
index 1b800d0..131550b 100644
--- a/test/PackageSmoke/Program.cs
+++ b/test/PackageSmoke/Program.cs
@@ -26,6 +26,17 @@ private static int Main(string[] args)
}
Console.WriteLine("png=ok");
+
+ // The OME-Zarr metadata is written with System.Text.Json, a package dependency of the netstandard builds.
+ var zarr = new OmeZarrGenerator(slide);
+ if (!zarr.TryGetEntry("zarr.json", out byte[]? group) ||
+ !System.Text.Encoding.UTF8.GetString(group).StartsWith("{\"zarr_format\":3,\"node_type\":\"group\",", StringComparison.Ordinal))
+ {
+ Console.WriteLine("zarr=bad");
+ return 5;
+ }
+
+ Console.WriteLine("zarr=ok");
#if SMOKE_ASPNETCORE
return AspNetCoreSmoke.RunAsync(args[0]).GetAwaiter().GetResult();
#else