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

Partial Implementation of Pydantic #45

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

Conversation

Nicholas-Schaub
Copy link
Contributor

@Nicholas-Schaub Nicholas-Schaub commented Jan 9, 2022

This PR converts most extension classes into pydantic classes.

The Extension class is not converted into a pydantic class because I am investigating a good approach to doing this. Effectively, Extension.py contains all information for package.json. The ideal approach is to get the json schema for package.json and autogenerate the pydantic classes, that way if the schema is updated then it is easy to update the class. However, there is no package.json schema that fits vscode extensions exactly. Rather, vscode uses NPMs package.json schema and then make modifications within the code rather than creating an actual schema.

What we can do is create an autogenerated package.json class, then make Extension a 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.

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

Successfully merging this pull request may close these issues.

None yet

1 participant