Commit 7c13fb3
fix: implement unevaluatedProperties as schema per JSON Schema 2020-12 (#2728)
* Initial plan
* feat: add UnevaluatedPropertiesSchema support to IOpenApiSchema
- Create IOpenApiSchemaWithUnevaluatedProperties interface for binary compatibility
- Add UnevaluatedPropertiesSchema property to OpenApiSchema
- Update OpenApiSchemaReference to implement new interface
- Update serialization to handle both boolean and schema cases
- Update V31 deserialization to handle both boolean and schema cases
- Add comprehensive documentation with TODO markers for next major version
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
* test: add comprehensive tests for UnevaluatedProperties
- Add serialization tests for boolean and schema cases
- Add deserialization tests for V3.1
- Add copy constructor test
- Fix default value to true (allowing unevaluated properties by default)
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
* fix: correct deserialization and test for UnevaluatedPropertiesSchema
- Fix deserialization to use ValueNode check like AdditionalProperties
- Fix copy constructor test to properly cast before modifying
- Update PublicAPI.Unshipped.txt with new API surface
- Update global.json to use available SDK version
- All UnevaluatedProperties tests now passing
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
* fix: address PR feedback on UnevaluatedProperties implementation
- Simplify copy constructor using pattern matching
- Add V3.2 deserialization support for UnevaluatedPropertiesSchema
- Add test for default value (no property set, defaults to true)
- Emit as x-jsonschema-unevaluatedProperties extension for versions < 3.1
- Add comprehensive tests for extension serialization in V2 and V3.0
- Add V3.2 deserialization tests
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
* refactor: use OpenApiConstants for extension name
- Added UnevaluatedPropertiesExtension constant to OpenApiConstants
- Replaced hardcoded "x-jsonschema-unevaluatedProperties" strings with constant
- Updated both V3.0 and V2.0 serialization paths
- Updated PublicAPI.Unshipped.txt with new constant
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
* chore: reverts dotnet version change
* chore: update benchmark reports
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
Co-authored-by: Vincent Biret <vibiret@microsoft.com>1 parent c7f9885 commit 7c13fb3
File tree
19 files changed
+675
-142
lines changed- performance/benchmark/BenchmarkDotNet.Artifacts/results
- src/Microsoft.OpenApi
- Models
- Interfaces
- References
- Reader
- V31
- V32
- test
- Microsoft.OpenApi.Readers.Tests
- V31Tests
- V32Tests
- Microsoft.OpenApi.Tests/Models
19 files changed
+675
-142
lines changedLines changed: 11 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 11 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 35 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
0 commit comments