From 16e3581a916bb51b070aa1ceb1230f0ee082ea31 Mon Sep 17 00:00:00 2001 From: John Andrews Date: Sat, 17 Feb 2024 07:49:10 +1300 Subject: [PATCH] updated generator --- Generators/RepoGenerator.cs | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/Generators/RepoGenerator.cs b/Generators/RepoGenerator.cs index 7c578f7..b652cea 100644 --- a/Generators/RepoGenerator.cs +++ b/Generators/RepoGenerator.cs @@ -117,7 +117,7 @@ private static List GetTemplates(string path, bool community = var isSubFlow = path.Contains("SubFlow") && path.Contains("Templates") == false; string content = File.ReadAllText(file.FullName); - var template = JsonSerializer.Deserialize(content, options); + var template = JsonSerializer.Deserialize(content, options); if (template == null) continue; @@ -128,7 +128,8 @@ private static List GetTemplates(string path, bool community = Revision = template.Revision, Uid = template.Uid, MinimumVersion = template.MinimumVersion, - Author = template.Author?.EmptyAsNull() ?? template?.Properties?.Author ?? string.Empty + Author = template.Author?.EmptyAsNull() ?? template?.Properties?.Author ?? string.Empty, + SubFlows = template.SubFlows?.Any() != true ? null : template.SubFlows }; if(isSubFlow) @@ -233,16 +234,36 @@ public class RepositoryObject /// Gets or sets the author /// public string Author { get; set; } + + /// + /// Gets or sets a list of sub flows this object depends on + /// + public List SubFlows { get; set; } } -public class RepositoryObjectWithProperties : RepositoryObject +/// +/// Sub Flow repository object +/// +public class SubFlowRepositoryObject : RepositoryObject { + /// + /// Gets or sets the properties for this sub flow + /// public RepositoryObjectProperties Properties { get; set; } } +/// +/// Properties of a repository object +/// public class RepositoryObjectProperties { + /// + /// Gets or sets the description of this object + /// public string Description { get; set; } + /// + /// Gets or sets the author of this object + /// public string Author { get; set; } } \ No newline at end of file