The Wayback Machine - https://web.archive.org/web/20220504042627/https://github.com/dotnet/core/pull/7214
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add schema declaration to the manifest file #7214

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Copy link
Member

@baronfel baronfel commented Feb 18, 2022

This change allows editors to highlight data errors. While this won't entirely prevent bad data, it opens the door to using the schema in more automated fashions (for example a unit test that validates the document according to the schema).

Here's what the experience looks like for a subset of invalid field data in VS Code:

image

and in VS:

image

The tooltips are powered by the schema and offer tips for fixing the problem:

image

allows editors to highlight data errors
@rbhanda
Copy link

@rbhanda rbhanda commented Feb 18, 2022

@leecow will this be a breaking change somehow to the release-index.json?

@baronfel
Copy link
Author

@baronfel baronfel commented Feb 18, 2022

I checked the .NET library that parses this file and it would not impact that library because it specifically pulls the releases-index property of the json document and then deserializes that array.

This library is used in the SDK, omnisharp, arcade, and probably others based on the NuGet listing, so I would hope that since it parses this correctly there would not be too much churn.

@leecow
Copy link

@leecow leecow commented Feb 18, 2022

My primary question is how is the schema maintained updated in the event of an update in either the json structure (e.g. adding a property) or updating valid values (which we will likely be doing for support phase)?

@baronfel
Copy link
Author

@baronfel baronfel commented Feb 18, 2022

The schema itself is currently housed here, and that repo has typically had relatively quick turnaround from my experience - usually within a few hours of PR submission assuming checks green eup.

There's an alternative here to including the schema annotation in the file - some IDEs can use an external setting to map a schema to a file, VSCode is great about this. I haven't yet found a similar mechanism for VS.

If agility in the schema itself is a requirement, the schema file could live in this repo, and schemastore could just be a pointer to the file in this repo. That's also a very quick change to make.

If breaking changes to the schema are made, then we'd need to version it (this is conventionally done by appending version numbers) and probably have the unversioned schema file alias the latest version. But I'd expect that most changes would be additive (a new property or a new enum case) in which case it's a fairly simple matter of adding a definition for the property/enum case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants