Create umbraco-jsonschema .NET tool to generate JSON schemas#13560
Closed
ronaldbarendse wants to merge 4 commits intov11/devfrom
Closed
Create umbraco-jsonschema .NET tool to generate JSON schemas#13560ronaldbarendse wants to merge 4 commits intov11/devfrom
umbraco-jsonschema .NET tool to generate JSON schemas#13560ronaldbarendse wants to merge 4 commits intov11/devfrom
Conversation
1 task
Contributor
|
This has grown stale, but feel free to recreate it against v15/dev if you still deem it relevant! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites
Description
This converts the
Umbraco.JsonSchemaconsole application into a .NET tool to generate JSON schemas from a specific type in an assembly file.Although the CMS still directly invokes the console application to generate the JSON schema for the CMS (at least for now), it now does so in the same way as invoking it as a .NET tool.
To this this, first check whether the
Umbraco.Cms.TargetsNuGet package still includes the generatedappsettings-schema.Umbraco.Cms.jsonfile (both on a local build and in the Azure Pipeline build artifacts). Next, create a local build, install the tool and generate the JSON schema using:After validating whether the generated JSON schema is correct, you can uninstall this global tool using
dotnet tool uninstall Umbraco.JsonSchema --global.We might want to move this into a separate repository, since we don't need new releases with every CMS version and the CMS can then also use the tool. Either way, once this tool is published on NuGet, this can be used as a local tool by other packages:
You can then create the C# class to generate the JSON schema from (e.g.
Umbraco.Forms.UmbracoFormsSchema) and add this to the same project file to automatically generate it on build and include it as part of the NuGet package (this generated JSON schema file can be added to.gitignore):The following build property file (e.g.
buildTransitive\Umbraco.Forms.props) ensures the JSON schema that's included in the NuGet package gets automatically copied into the Umbraco project directory and added as a reference in theappsettings-schema.jsonfile: