Commit c75c551
deps: Bump the build-tools group with 3 updates (#418)
* deps: Bump the build-tools group with 3 updates
Bumps Microsoft.CodeAnalysis.Analyzers from 3.11.0 to 5.3.0
Bumps Microsoft.CodeAnalysis.CSharp from 4.8.0 to 5.3.0
Bumps Microsoft.CodeAnalysis.CSharp.CodeFix.Testing from 1.1.2 to 1.1.3
---
updated-dependencies:
- dependency-name: Microsoft.CodeAnalysis.Analyzers
dependency-version: 5.3.0
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: build-tools
- dependency-name: Microsoft.CodeAnalysis.CSharp
dependency-version: 5.3.0
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: build-tools
- dependency-name: Microsoft.CodeAnalysis.CSharp.CodeFix.Testing
dependency-version: 1.1.3
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: build-tools
...
Signed-off-by: dependabot[bot] <support@github.com>
* Bump transitive BCL package versions for Roslyn 5.3.0 and ignore CS1701/CS1702 binding-redirect warnings on .NET Framework
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Bump JsonSchema.Net to 9.2.0 and update for new API
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove CS1701/CS1702 suppressions
The underlying cause (mismatched BCL transitive package versions pulled in by Microsoft.CodeAnalysis.CSharp 5.3.0) is fully addressed by the central package bumps; the suppressions are no longer needed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address format-validation by declaring $schema dialect
Replaces the format-error filter with the proper fix: prepend a draft 2020-12 $schema declaration so JsonSchema.Net 9.x treats the ormat keyword as an annotation rather than an assertion.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Emit $schema dialect from JsonSchemaGenerator
Generated root schemas now declare the JSON Schema 2020-12 dialect, ensuring spec-compliant interpretation of keywords like `format` (annotation, not assertion) by validators such as JsonSchema.Net 9.x. Tests that compare root schemas to nested sub-schemas strip `\` before structural comparison.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Inline $schema dialect emission via depth tracking
Replaces the post-processing AddSchemaDialect helper (which allocated a second JsonObject solely to insert $schema as the first keyword) with depth tracking inside GenerateSchema. Root schemas are preallocated with the $schema keyword in place; recursive calls bump depth so nested subschemas do not redundantly emit it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Construct $schema dialect at the point of root JsonObject creation
Replaces the post-construction EnsureSchemaDialect helper with a NewSchema(depth) factory used by every switch-case construction. When depth == 0 the factory preallocates the JsonObject with $schema as the first keyword, so the dialect is set at construction time rather than reordered after the fact.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove `$schema` mutations from JsonSchema test assertions
Replaces the `.Remove("$schema")` calls with a non-mutating `RootEqualsSubschema` helper used where a regenerated root schema is compared against a nested sub-schema (enumerable items / dictionary additionalProperties). For IOptionalTypeShape and ISurrogateTypeShape both sides are roots with identical `$schema` entries, so `JsonNode.DeepEquals` handles them directly. The default-case assertion now verifies `$schema` is the sole key rather than stripping it first.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Simplify $schema dialect emission via JsonObject.Insert
Replace the NewSchema(depth) factory and preallocation sites with a single InsertDialectIfRoot helper invoked at root-level exit points. Uses JsonObject.Insert on net9+ and a clear-and-reassign polyfill on earlier TFMs to keep $schema as the first keyword.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Reference System.Text.Json on net8.0 to enable JsonObject.Insert
Extends the System.Text.Json package reference (already at v10.0.5) to net8.0 so JsonObject.Insert is available everywhere PolyType.Examples is built. This removes the need for the polyfill in JsonSchemaGenerator.InsertDialectIfRoot.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Merge ApplyNullability and InsertDialectIfRoot into CompleteDocument
Consolidates the post-construction nullability and root $schema insertion logic into a single CompleteDocument helper invoked at every exit point. The IOptionalTypeShape case now sets allowNull=true so the merged helper handles its nullability (eliminating the previous double-application). Also drops the "dialect" terminology in favor of MetaSchemaUri.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Drop CompleteDocument implementation comments
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Make MetaSchemaUri private
Inline the literal in tests since the constant is no longer part of the public API.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Share a single Generator instance across IMethodShape sub-schemas
Move the IMethodShape orchestration into Generator.GenerateMethodSchema so a single Generator instance (and its $ref location cache) spans the parameter and return sub-schemas. Push/Pop the JSON pointer path around each sub-schema so cached references stay valid within the function document. Reduces per-method allocations from N+1 Generator instances to 1.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Revert RoslynVersion to 4.8.0 to keep VS 2022 source generator support
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Scope JsonSchema.Net and BCL 10 deps to PolyType.Tests
Keep root Directory.Packages.props at conservative versions matching main so library-shipped packages do not force higher BCL minima on consumers. JsonSchema.Net 9.2 (and the BCL 10 minima it pulls in transitively) only need to be visible to PolyType.Tests, so move those overrides into a scoped tests/PolyType.Tests/Directory.Packages.props.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Move tests Directory.Packages.props up to tests/
Shield PolyType.SourceGenerator.UnitTests with a pass-through Directory.Packages.props that imports the repo root directly, so its CompilationTests do not pick up the higher BCL minima from tests/Directory.Packages.props (which would cause CS1702 assembly-version mismatches in synthesized compilations).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Move test-only package versions out of the root central props
Move xunit/TUnit/Microsoft.Testing.Extensions/BenchmarkDotNet/CodeFix.Testing and the JsonSchema.Net + BCL 10 overrides into tests/Directory.Packages.props. The benchmarks and source-generator unit tests projects keep their own scoped Directory.Packages.props (now imported into the slnx and noted in the root props) for project-specific overrides. Update Benchmarks props to import the tests/ scoped file so it picks up BenchmarkDotNet.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Bump System.* packages to .NET 10 baseline
Bump System.Memory/Unsafe/Tasks.Extensions to 4.6.3/6.1.2/4.6.3 and System.Collections.Immutable/System.Formats.Cbor/System.Text.Json to 10.0.5/10.0.0/10.0.5. Removes the redundant BCL Update entries (including STJ) from tests/Directory.Packages.props and the no-longer-needed pass-through props in tests/PolyType.SourceGenerator.UnitTests. Microsoft.Extensions.Configuration is intentionally kept at 9.0.8 because 10.x changes object binding behavior in a way that triggers infinite recursion in the example ConfigurationBinder.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Document and trim Benchmarks scoped Directory.Packages.props
Drop the now-redundant System.Collections.Immutable override (root is at 10.0.5 which is higher than the 9.0.0 BenchmarkDotNet pulls in transitively). Keep the Microsoft.CodeAnalysis.CSharp override and add a comment explaining why the project-scoped CPM file is necessary: BenchmarkDotNet 0.15.8 transitively requires Roslyn >= 4.14.0 while the solution-wide RoslynVersion is pinned at 4.8.0 to keep the source generator usable in VS 2022.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Pin Microsoft.Extensions.Configuration to 9.0.8
In Microsoft.Extensions.Configuration.Json 10.x, a JSON `null` literal and an empty object `{}` produce identical IConfigurationSection state (Value=null, no children) and are no longer distinguishable at the IConfiguration API surface. The PolyType example ConfigurationBinder relies on this distinction to bind null vs empty objects correctly. Since this cannot be worked around without changing the binder contract, and PolyType.Examples is a packable library where conservative dependency versions are preferred, keep MEC at 9.0.8.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Simplify JsonSchema test helper by stripping $schema before DeepEquals
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Restore original Push/Pop method positions
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Replace project-scoped CPM with VersionOverride in Benchmarks csproj
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Restore conservative product dependency versions in root props
BCL packages bumped by JsonSchema.Net 9.x transitive requirements are scoped to tests/Directory.Packages.props via Update overrides, keeping the packable PolyType.Examples and core projects on the minimum-supported BCL versions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Soften MEC pin comment (no documented breaking change)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Cite official .NET 10 breaking change in MEC pin comment
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Adopt Microsoft.Extensions.Configuration 10.x semantics
MEC 10.x preserves JSON null literals as IConfigurationSection.Value=null instead of collapsing them to empty strings (https://learn.microsoft.com/dotnet/core/compatibility/extensions/10.0/configuration-null-values-preserved). Drop the empty-string-to-null workarounds from the example ConfigurationBinder and align IsNullConfiguration with the new semantics. Empty objects '{}' remain indistinguishable from nulls at the IConfigurationSection level; the test suite accommodates this by skipping equality assertions for nested empty objects.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Move Roslyn version override into tests/Directory.Packages.props
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Bump central System.* package versions, pin core PolyType conservatively
Inverts the earlier policy: the root Directory.Packages.props now declares bleeding-edge versions for System.Memory, System.Runtime.CompilerServices.Unsafe, System.Threading.Tasks.Extensions, System.Collections.Immutable, System.Formats.Cbor, and System.Text.Json. The core PolyType library opts back down to conservative minima via VersionOverride in src/PolyType/PolyType.csproj. This cleans up redundant overrides scattered across PolyType.Examples.csproj and tests/Directory.Packages.props.
Suppress CS1702 in PolyType.SourceGenerator.UnitTests, which surfaced on net472 once the test compilations started referencing the bumped System.Memory while PolyType itself remained pinned to the older assembly version.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Disable global transitive pinning for package compatibility
Stop centrally pinning transitive dependencies solution-wide. This keeps analyzer packages like PolyType.SourceGenerator from advertising newer System.* transitive dependencies than their direct Roslyn references require, which is important for older Visual Studio compatibility. Keep the conservative runtime BCL floor pinned only in src/PolyType/PolyType.csproj via VersionOverride.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix netfx unit test restore
Add a direct reference to Microsoft.CodeAnalysis.CSharp.Workspaces in the source generator unit test project so NuGet resolves the modern Roslyn workspace stack during net472 test runs, without reintroducing global transitive pinning.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix netfx tests without warning suppression
Pin the full Roslyn test stack in tests/Directory.Packages.props and remove the temporary CS1702 suppression from CompilationHelpers. The net472 source-generator unit test leg now passes cleanly by resolving the intended package versions rather than hiding the warning.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix up
* Remove unnecesary dependency
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 613cc04 commit c75c551
9 files changed
Lines changed: 150 additions & 110 deletions
File tree
- src/PolyType.Examples
- ConfigurationBinder
- JsonSchema
- tests
- PolyType.Benchmarks
- PolyType.SourceGenerator.UnitTests
- PolyType.Tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
| 14 | + | |
16 | 15 | | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
40 | 28 | | |
41 | 29 | | |
42 | | - | |
43 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | 51 | | |
54 | | - | |
| 52 | + | |
Lines changed: 11 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | | - | |
323 | | - | |
324 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | | - | |
336 | | - | |
337 | 335 | | |
338 | 336 | | |
339 | 337 | | |
| |||
367 | 365 | | |
368 | 366 | | |
369 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
370 | 373 | | |
371 | 374 | | |
372 | 375 | | |
| |||
379 | 382 | | |
380 | 383 | | |
381 | 384 | | |
382 | | - | |
| 385 | + | |
383 | 386 | | |
384 | 387 | | |
385 | | - | |
386 | | - | |
| 388 | + | |
387 | 389 | | |
388 | 390 | | |
389 | 391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 33 | + | |
67 | 34 | | |
68 | 35 | | |
69 | 36 | | |
| |||
87 | 54 | | |
88 | 55 | | |
89 | 56 | | |
90 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
91 | 102 | | |
92 | 103 | | |
93 | 104 | | |
94 | 105 | | |
95 | 106 | | |
96 | | - | |
| 107 | + | |
97 | 108 | | |
98 | 109 | | |
99 | 110 | | |
| |||
125 | 136 | | |
126 | 137 | | |
127 | 138 | | |
128 | | - | |
129 | | - | |
| 139 | + | |
| 140 | + | |
130 | 141 | | |
131 | 142 | | |
132 | 143 | | |
133 | | - | |
| 144 | + | |
134 | 145 | | |
135 | 146 | | |
136 | 147 | | |
137 | 148 | | |
138 | 149 | | |
139 | 150 | | |
140 | 151 | | |
141 | | - | |
| 152 | + | |
142 | 153 | | |
143 | 154 | | |
144 | 155 | | |
| |||
155 | 166 | | |
156 | 167 | | |
157 | 168 | | |
158 | | - | |
| 169 | + | |
159 | 170 | | |
160 | 171 | | |
161 | 172 | | |
| |||
191 | 202 | | |
192 | 203 | | |
193 | 204 | | |
194 | | - | |
| 205 | + | |
195 | 206 | | |
196 | 207 | | |
197 | 208 | | |
| |||
220 | 231 | | |
221 | 232 | | |
222 | 233 | | |
223 | | - | |
| 234 | + | |
224 | 235 | | |
225 | 236 | | |
226 | 237 | | |
| |||
274 | 285 | | |
275 | 286 | | |
276 | 287 | | |
277 | | - | |
| 288 | + | |
278 | 289 | | |
279 | 290 | | |
280 | 291 | | |
| |||
293 | 304 | | |
294 | 305 | | |
295 | 306 | | |
296 | | - | |
| 307 | + | |
297 | 308 | | |
298 | 309 | | |
299 | 310 | | |
| |||
306 | 317 | | |
307 | 318 | | |
308 | 319 | | |
309 | | - | |
| 320 | + | |
310 | 321 | | |
311 | 322 | | |
312 | 323 | | |
313 | | - | |
| 324 | + | |
314 | 325 | | |
315 | 326 | | |
316 | 327 | | |
| |||
320 | 331 | | |
321 | 332 | | |
322 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
323 | 339 | | |
324 | 340 | | |
325 | 341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
This file was deleted.
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
107 | 114 | | |
108 | 115 | | |
109 | 116 | | |
110 | 117 | | |
111 | | - | |
| 118 | + | |
112 | 119 | | |
113 | 120 | | |
114 | 121 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
0 commit comments