Skip to content

Honor value/element nullability in JSON schema; make child-process environment configurable#289

Merged
rdeago merged 14 commits into
Tenacom:mainfrom
rdeago:feature/json-schema-value-nullability
May 31, 2026
Merged

Honor value/element nullability in JSON schema; make child-process environment configurable#289
rdeago merged 14 commits into
Tenacom:mainfrom
rdeago:feature/json-schema-value-nullability

Conversation

@rdeago
Copy link
Copy Markdown
Member

@rdeago rdeago commented May 31, 2026

Preparatory work for #269 (Config Phase 2). No CLI surface changes; sets up the schema and process-runner plumbing that #269 will wire to buildvana.json.

JSON schema value nullability

  • Reconcile the nullability System.Text.Json's exporter forces onto every reference-type dictionary value and collection element against the model's declared nullability (string vs string?), read from the owning member via NullabilityInfoContext. null is now kept only where the model actually declares it, recursing through nested generics.
  • Allow null values for dotnet environment variables (DotNetInvocationConfig.EnvIReadOnlyDictionary<string, string?>?); the generated schema now accepts ["string","null"] for those values.
  • Remove the unused JsonSchemaValidationException and JsonSchemaValidator.ValidateAndThrow.

Configurable child-process environment

  • Thread an optional environment argument through IProcessRunner.RunAsyncProcessRunner (CliWrap WithEnvironmentVariables, overlaying the inherited environment; a null value unsets a variable) → DotNetService.RunDotNetAsync. Not yet sourced from config — Config Phase 2 — wire existing bv options to buildvana.json #269 connects it.

Static analysis & tooling

  • Move static-analysis configuration from .globalconfig into .editorconfig, with a test-specific overlay; refresh ReSharper settings; add JetBrains.Annotations.Sources to all C# projects; resolve/suppress the remaining ReSharper diagnostics; set JSON language mode for SARIF files in VS Code.

Fixes

  • dotnet nuget push has no --verbosity option; route NuGetPushAllAsync through an invocation kind that streams output without appending verbosity, so package pushes don't fail.

No CHANGELOG entry: nothing here changes released behavior (the push fix corrects a regression introduced earlier on this same branch), and the env config knob has no effect until #269 wires it.

rdeago and others added 14 commits May 31, 2026 10:56
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The exception type and the JsonSchemaValidator.ValidateAndThrow() method
had no callers and are unlikely to be needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
System.Text.Json marks every reference-type dictionary value and
collection element nullable regardless of the model's annotation, so the
generator stripped null everywhere and a genuinely nullable value (e.g.
IReadOnlyDictionary<string, string?>) lost its null. Read the declared
nullability from the owning property or field via NullabilityInfoContext
and reconcile the exporter's output against it, recursing through nested
generics. Value and element nodes no longer strip null themselves; the
owning property decides, since the exporter gives no usable signal there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Make DotNetInvocationConfig.Env values nullable so a configured variable
can carry an explicit null, and regenerate buildvana.schema.json, whose
additionalProperties now permits ["string", "null"].

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Apparently ReSharper in VS Code does not honor .globalconfig at
design time.
Some diagnostics are better relaxed or suppressed in tests: consistency
among tests is more important that some style rules.
Remove some properties that TUnit provides for us.
Suppress some diagnostics via .editorconfig files; fix what remains.
@github-actions github-actions Bot added area:code [issue/PR] affects project code (excluding tests). area:style [issue/PR] affects editor / code analysis settings. labels May 31, 2026
@rdeago rdeago added enhancement [issue/PR] requests / implements new or improved functionality. refactor [issue/PR] requests / implements a refactor of existing code without affecting functionality. and removed area:code [issue/PR] affects project code (excluding tests). area:style [issue/PR] affects editor / code analysis settings. labels May 31, 2026
@rdeago
Copy link
Copy Markdown
Member Author

rdeago commented May 31, 2026

This PR has been reviewed locally.

@rdeago rdeago merged commit b4f4502 into Tenacom:main May 31, 2026
5 of 6 checks passed
@rdeago rdeago deleted the feature/json-schema-value-nullability branch May 31, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement [issue/PR] requests / implements new or improved functionality. refactor [issue/PR] requests / implements a refactor of existing code without affecting functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant