chore(release): prepare the first stable release (2.0.0) - #49
Merged
Merged
Conversation
package.json now reports the first stable version, 2.0.0, and the release-flow docs describe the stable line instead of the 2.0.0-prerelease.* line.
Fold every rule that was pending in AnalyzerReleases.Unshipped.md into the new 2.0.0 section of AnalyzerReleases.Shipped.md, preserving each rule id, category, severity and notes. The unshipped file keeps the standard Roslyn header and an empty new-rules table.
Move FromJsonSchemaParser, JsonSchemaSerializerOptions and ZExtensions into the ZodSharp.JsonSchema.SystemTextJson and ZodSharp.JsonSchema.NewtonsoftJson namespaces so both JSON packages can be referenced from one project without extern alias. Remove the empty FromJsonSchemaOptions type and the options parameter from Z.FromJsonSchema and FromJsonSchemaParser.Parse in both packages. Bind the JSON Schema keyword names ($schema, $id, $ref, $defs) when reading and writing JsonSchemaDefinition, and ignore JSON metadata handling in the Newtonsoft reader, which previously consumed $ref as metadata and produced null property schemas. BREAKING CHANGE: Z.FromJsonSchema no longer accepts FromJsonSchemaOptions and now requires the JSON integration package namespace import.
Add a JsonInterop.UnitTests project that references both JSON integration packages to prove they can be used together without extern alias, parser tests for local and external $ref plus JSON Schema keyword naming, a release-tracking guard test, and a multi-targeting test.
Update the wiki, README and package READMEs for the stable 2.0.0 release: the package specific JSON Schema namespaces, the removed options type, the external $ref message, the JSON Schema keyword names, the ZODSASP diagnostics table and the shipped ZODSGEN rules.
…kages Keep JsonSchemaDefinition free of serializer annotations: the shared POCO stays serializer-agnostic and each integration package maps the JSON Schema keyword names ($schema, $id, $ref, $defs) in its own options - a naming policy for System.Text.Json and a naming strategy for Newtonsoft.Json (which keeps MetadataPropertyHandling.Ignore so the reader does not treat $ref as JSON metadata). Fail with an actionable ArgumentException instead of a NullReferenceException when a converted schema graph contains a null sub-schema, and cover both behaviours with tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepare ZodSharp for the first stable release (2.0.0)
Summary
Drops the prerelease tag for the first stable release, finalises the analyzer release tracking, resolves the
three public-surface decisions from the task, and syncs docs, READMEs, samples and tests.
This PR does not publish, tag or release anything. Merging to
maintriggersrelease.yml(
purview-release.yml,release-mode: NuGet), which tagsv2.0.0frompackage.jsonand publishes the fourpackages.
purview-build.jsonis unchanged (Release.ModestillNone, no validation rule weakened).Work item checklist
## Release 2.0.0inAnalyzerReleases.Shipped.mdcarriesZODSGEN020,021,027-036,ZODSASP001/002/003/100/101;AnalyzerReleases.Unshipped.mdkeeps the standard Roslyn header and an empty new-rules table. All 35 IDs defined inDiagnosticLibrary.csare tracked in exactly one file (ZODSGEN002,ZODSGEN022-026remain intentional gaps). The tracking analyzer is live - a probe rule reportedRS2000as an error - so the clean build means zeroRS2000/RS2001/RS2002/RS2007.package.jsonis2.0.0,just versionprints2.0.0,docs/wiki/Release-Flow.mddescribes the stable line. No stale2.0.0-prerelease.*references remain.FromJsonSchemaOptionspublic typeoptionsparameters removed from both packages.$refin JSON Schema importGuarantees-and-Limitations,JsonSchema-Import,JsonSchema-Export,SystemTextJson-Integration,NewtonsoftJson-Integration,AspNetCore-Integration(newZODSASPdiagnostics table),Source-Generator-Diagnostics(severity note + unused-ID gaps),Getting-Started,Cross-Platform-Interop,README.mdand both package READMEs.Examples.CLIand all samples/benchmarks build; new tests below;bun run testfixtures unchanged and green.Section 3 decisions
FromJsonSchemaOptions+ bothoptionsparameters)ZodSharp.JsonSchema.SystemTextJson/ZodSharp.JsonSchema.NewtonsoftJson(parser, serializer options,Z.FromJsonSchemahost class)extern alias; the JSON integrations stay mutually exclusive by usage (import one package namespace per file).NotSupportedExceptionnames the offending reference and explains how to resolve it$refresolution needs IO/base-URI plumbing that does not belong in this release; the failure is now diagnosable and covered by tests in both packages.Corrected keyword handling found while implementing 3c (
86262af, revised inf0b3aee)The
$ref/$defssupport that 3c builds on was effectively broken:"$ref"/"$defs"in an authoredJSON string were silently ignored (local
$refonly ever worked for in-memory definitions, andToJsonSchemawrote non-conformantref/defs/schema/idnames).$refas JSON metadata and deserialized such schemas tonull, whichmade
FromJsonSchemaParser.ConvertSchemathrowNullReferenceException.The final design keeps the shared POCO serializer-agnostic and gives each integration package ownership of
the JSON Schema keyword names:
Purview.ZodSharp.SystemTextJson: aJsonSchemaNamingPolicy($schema/$id/$ref/$defs, camelCase foreverything else) used by both
JsonSchemaSerializerOptions.Defaultand.Reading.Purview.ZodSharp.NewtonsoftJson: an equivalent naming strategy on the contract resolver, plusMetadataPropertyHandling.Ignoreso$refis no longer swallowed as metadata.JsonSchemaDefinitionitself carries no serializer annotations, and a null sub-schema now fails with anactionable
ArgumentExceptioninstead of aNullReferenceException.Behaviour change to serialized JSON Schema output (it now matches the JSON Schema specification and this
repo's own documentation); the core POCO is unchanged apart from that guard, and
purview-build.jsonRequiredContent/ForbiddenContentare unaffected.Tests added
src/tests/JsonInterop.UnitTests/- new project referencing both JSON packages: proves they compiletogether without
extern alias, that the import types have distinct full names, and that each package'snamespace binds
Z.FromJsonSchemaand its own serializer options type.SystemTextJson.UnitTests/Json/Schema/FromJsonSchemaParserTests.csand the Newtonsoft equivalent - local$refresolution, external$refexception (type + message naming the reference), null-definition guard,JSON Schema keyword naming vs camelCase naming, and the new null-sub-schema failure.
SourceGenerators.UnitTests/AnalyzerReleaseTrackingTests.cs- guards the shipped/unshipped files, the## Release 2.0.0section, the empty unshipped table and "one tracking entry per rule".ZodSharp.UnitTests/Core/MultiTargetingTests.cs- asserts the core assembly declares one of the supportedtarget frameworks (
net8.0/net9.0/net10.0) on every run.Validation
just versionCurrent Version: 2.0.0just lint-checkChecked 294 files- no formatting changesjust buildRS2000/RS2001/RS2002/RS2007)just testnet8.0/net9.0/net10.0just pipeline-pr[PackValidation] Valid packages: 8/8;[Version] Package version: 2.0.0just pipeline-pack-validatef0b3aee) -Valid packages: 8/8,Invalid packages: 0/8bun run testPack inspection (
artifacts/, all at2.0.0):Purview.ZodSharp.2.0.0.nupkg:analyzers/dotnet/cs/Purview.ZodSharp.SourceGenerators.dll,buildTransitive/Purview.ZodSharp.props,lib/{net8.0,net9.0,net10.0}/Purview.ZodSharp.{dll,xml},purview-logo-light.png,README.md- exactlyRequiredContent, and noanalyzers/**/Purview.SourceGeneratorFramework.dll(ForbiddenContent)..snupkgsymbol packages exist for all four packages (RequireSymbolPackage) and contain the per-TFM.pdbfiles (RequireSymbolFiles).Notes / review points
(
DeserializeAndValidate,ValidateAndSerialize) intentionally remain in theZodSharpnamespace in bothpackages, matching the "mutually exclusive integrations" decision - importing both namespaces in one file
still makes those calls ambiguous. Documented as a guarantee in
Guarantees-and-Limitations.md.rather than as attributes on the shared POCO. Consumers who serialize
JsonSchemaDefinitionwith their ownserializer options get PascalCase names (as before), so use the package's
JsonSchemaSerializerOptionsforkeyword-compliant output.
f0b3aeecarries the revision.JsonInterop.UnitTestsproject: added tosrc/ZodSharp.slnx; picked up by pipeline test discovery(
*Tests.csprojundersrc/tests) with nopurview-build.jsonchange.commitlintin this environment rejects the!breaking-change shorthand (reports anempty
type/subject), so86262afmarks the break with a canonicalBREAKING CHANGE:footer instead.No hooks were bypassed.