-
Notifications
You must be signed in to change notification settings - Fork 25
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
Schema Analyzer to infer component schemas from classes #498
Conversation
0842767
to
2ab10a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this just return a schema? Don't we need to keep the schema together with construct functions that can implement it
This is mostly a utility class, it will be used in a provider implementation similar to this Java one |
/// <returns>A PackageSpec containing the complete schema for all components and their types</returns> | ||
public static PackageSpec GenerateSchema(Metadata metadata, params Type[] componentTypes) | ||
{ | ||
if (metadata?.Name == null || string.IsNullOrWhiteSpace(metadata.Name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we evaulate this against the same regex we have in pulumi.json
?
Also micronit, I'd prefer curly braces in all if statements even if they are just one line. Not sure we have a linter or guidelines for that though.
8595302
to
5e0ca99
Compare
5e0ca99
to
b08bc13
Compare
Implements
ComponentAnalyzer.GenerateSchema
which takes either an assembly or a list of component resources and produces a serializable package schema structure. Infers component resources and their dependent types. Here are the features that this PR implements and tests:Resolve #468 (we'll track missing features in separate issues)