This repository was archived by the owner on Nov 21, 2024. It is now read-only.
Partial Implementation of Pydantic#45
Open
Nicholas-Schaub wants to merge 1 commit intoCodeWithSwastik:mainfrom
Open
Partial Implementation of Pydantic#45Nicholas-Schaub wants to merge 1 commit intoCodeWithSwastik:mainfrom
Nicholas-Schaub wants to merge 1 commit intoCodeWithSwastik:mainfrom
Conversation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR converts most extension classes into pydantic classes.
The
Extensionclass is not converted into a pydantic class because I am investigating a good approach to doing this. Effectively,Extension.pycontains all information forpackage.json. The ideal approach is to get the json schema forpackage.jsonand autogenerate the pydantic classes, that way if the schema is updated then it is easy to update the class. However, there is nopackage.jsonschema that fits vscode extensions exactly. Rather, vscode uses NPMspackage.jsonschema and then make modifications within the code rather than creating an actual schema.What we can do is create an autogenerated
package.jsonclass, then makeExtensiona subclass and make the necessary changes to conform to vscode.This PR also enforces some standards outlined in the vscode docs. For example, package versions should follow semantic versioning, so the pydantic classes validate the input version that is supplied to the class.