vscode.py icon indicating copy to clipboard operation
vscode.py copied to clipboard

Partial Implementation of Pydantic

Open Nicholas-Schaub opened this issue 3 years ago • 0 comments

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.

Nicholas-Schaub avatar Jan 09 '22 18:01 Nicholas-Schaub