v14: JSON schema tool improvements (#16035)

* Use require modifier instead of setting null-suppressed default values

* Only remove read-only properties when IgnoreReadOnlyProperties is set

* Obsolete UmbracoPath property and remove work-around for obsolete setter
This commit is contained in:
Ronald Barendse
2024-04-15 08:58:52 +02:00
committed by GitHub
parent 767c417153
commit ad82fe89cf
5 changed files with 48 additions and 52 deletions

View File

@@ -1,5 +1,4 @@
using CommandLine;
using Umbraco.Cms.Core.Configuration.Models;
await Parser.Default.ParseArguments<Options>(args).WithParsedAsync(async options =>
{
@@ -7,8 +6,5 @@ await Parser.Default.ParseArguments<Options>(args).WithParsedAsync(async options
var jsonSchemaGenerator = new UmbracoJsonSchemaGenerator();
var jsonSchema = jsonSchemaGenerator.Generate(typeof(UmbracoCmsSchema));
// TODO: When the UmbracoPath setter is removed from GlobalSettings (scheduled for V12), remove this line as well
jsonSchema.Definitions[nameof(GlobalSettings)]?.Properties?.Remove(nameof(GlobalSettings.UmbracoPath));
await File.WriteAllTextAsync(options.OutputFile, jsonSchema.ToJson());
});