Comments (7)
@Falco20019 @martincostello @omajid @leecow @rbhanda @baronfel
from core.
That's correct, $schema
has no special meaning in the context of plain old JSON serialization. Either removing UnmappedMemberHandling
or making sure that it is being mapped to a property should resolve this for you:
[JsonPropertyName("$schema")]
public Uri? Schema { get; init; }
from core.
You could have a separate repo on dotnet
for the tooling. Would make sense also for the nuget package linking to it. Then you can release it as dotnet tool for easy usage as global tool (most propably what you suggested).
from core.
I just found a minor issue with https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.json#L341
10-20h2-e-lts
does not exist, only 10-20h2-e
which is already correclty in unsupported-versions
. If I don't forget it, I will do a PR.
from core.
I found that added a $schema
node can be a breaking change.
I did the following (in order, going back a bit):
- Wrote tools to process the various JSON files in the repo.
- Wrote a tool to generate schema files.
- Ran the tools.
- Added
[JsonUnmappedMemberHandling(JsonUnmappedMemberHandling.Disallow)]
to the OM and re-ran the generation tool. - Manually added a
$schema
node to some of the JSON files - Time passed
- Re-ran the tools. They broke.
- Error:
Unhandled exception. System.Text.Json.JsonException: The JSON property '$schema' could not be mapped to any .NET member contained in type 'DotnetRelease.OSPackagesOverview'.
- Commenting out the
JsonUnmappedMemberHandling
attribute on the root object in the OM solved the problem.
The long and short of it is the following:
- Adding a
$schema
node after the fact can break consumers, if they have their own custom OM. - Adding a
$schema
node prevents the use ofJsonUnmappedMemberHandling.Disallow
on the root object.
If there is something I'm doing wrong, that would be good to know. I don't think this finding is a huge problem, but it should influence our use of the $schema
node and how we construct the schema.
from core.
Interesting finding. I would assume that JsonUnmappedMemberHandling.Disallow
should not check $schema
as it's a well-known node. But maybe @eiriktsarpalis can give us more insights. Maybe theres another attribute for setting the schema?
from core.
My conclusion is that STJ has no allowance for schemas meaning that the schema node is just another node.
from core.
Related Issues (20)
- .NET Integration Test Singleton Service instantiated twice HOT 1
- https://github.com/dotnet/core/blob/main/Documentation/core-repos.md does not reference Blazor at all! HOT 2
- We are pleased to announce the release of .NET 9 Preview 6.
- [Infra] Helix container image on https://github.com/dotnet/dotnet-buildtools-prereqs-docker
- .NET August 2024 Update - .NET 8.0.8, .NET 6.0.33 HOT 8
- Inaccurate description and issue/PR link in Preview 7: Object Stack Allocation for Boxes section
- Docker images should point to mcr.microsoft instead of hub.docker HOT 9
- .NET 9 Preview 7 Release notes docs link is wrong or not available HOT 2
- Checksums missing for ASP.NET 8.0.8 et al HOT 1
- Outdated release json file for 8.0 HOT 1
- Add support for macOS Sequoia
- [CoreCLR/CoreFX] Runtime / RID Support update HOT 2
- Helix image support
- [Acquisition] docker support HOT 1
- [All teams] Update test infrastructure to support the new version
- "Out of support OS versions" table for .NET 6 reports misleading or conflicting information. HOT 5
- Broken links on releases HOT 1
- Issues with C++/CLI code on Windows arm64 HOT 6
- Add support for Fedora 41 HOT 4
- opusarchitects
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.