Structure
JSONReporter
Encodes ActionResultEnvelope values to JSON strings for CLI output.
struct JSONReporterOverview
Used by CLI commands when --output json is specified to produce machine-readable output suitable for CI systems.
Usage
let reporter = JSONReporter()
let envelope = ActionResultEnvelope(action: "build", status: "success", payload: nil)
let json = try reporter.encode(envelope)
print(json)Topics
Initializers
init(prettyPrint: Bool)Creates a
JSONReporterwith pretty-printed output by default.
Instance Methods
func encode(ActionResultEnvelope) throws -> StringEncodes an
ActionResultEnvelopeto a JSON string.func encodeAny<T>(T) throws -> StringEncodes any
Encodablevalue to a JSON string.
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype