JsonAliases Class

Summary

JSON related cake aliases.

In order to use aliases from this addin, you will need to also reference Newtonsoft.Json as an addin. Here is what including Cake.Json in your script should look like:

#addin package:?Cake.Json
#addin package:?Newtonsoft.Json&version=11.0.2

Assembly
Cake.Json.dll
Namespace
Cake.Json
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["JsonAliases"] class Type type-node

Syntax

public static class JsonAliases

Attributes

Type Description
CakeAliasCategoryAttribute

Methods

Name Value Summary
DeserializeJson<T>(ICakeContext, string) T
Deserializes the JSON from a string.
static
DeserializeJsonFromFile<T>(ICakeContext, FilePath) T
Deserializes the JSON from a file.
static
ParseJson(ICakeContext, string) JObject
Parses the JSON into a JObject.
static
ParseJsonFromFile(ICakeContext, FilePath) JObject
Parses the file contents into a JObject.
static
SerializeJson<T>(ICakeContext, T) string
Serializes an object to a JSON string.
static
SerializeJsonPretty<T>(ICakeContext, T) string
Serializes an object to a pretty JSON string.
static
SerializeJsonToFile<T>(ICakeContext, FilePath, T) void
Serializes an object to a JSON file.
static
SerializeJsonToPrettyFile<T>(ICakeContext, FilePath, T) void
Serializes an object to a pretty JSON file.
static

Extension Methods

Name Value Summary
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin
ToStringWithNullMarkup() string
Requires the Cake.Issues addin