This readme provides instructions on how to use the ExistingPackage NuGet package, which includes a GeneratedAttribute and the ServiceProvider functionality.
- Now that the ExistingPackage NuGet package is installed in your project, follow these steps to use the included features:
- In your project, import the namespace where the generated attribute is used:
using JsonSchema.GSoC2024.ExistingPackage;- Now, declare the generated attribute with two string parameters, where the first parameter is the path to a JSON schema file, and the second parameter is the namespace (JsonSchema.GSoC2024.CorvusQualification).below the namespace
[assembly: Generated("path/to/schema.json", "JsonSchema.GSoC2024.CorvusQualification")]As the attribute is assembly level it is recommended to use it in assembly info.cs in case of .net framework and create a separate file called assembly info.cs and use it in case of others
-
(Optional) Rebuild the project to create the source code.
-
(Optional) You can see the autogenerated c# code by
ctrl+clickthe attributes :
After Successful declaration, you will notice an analyzer under dependencies
- In your project, create an instance of the ServiceProvider class and use it as needed:
using JsonSchema.GSoC2024.ExistingPackage;
namespace YourNamespace
{
public class YourClass
{
ServiceProvider serviceProvider = new ServiceProvider();
}
}

