Enumeration

JSONEncoder.KeyEncodingStrategy

The values that determine how a type's coding keys are encoded as JSON keys.

Overview

Topics

Built-in Encoding

case convertToSnakeCase

A key encoding strategy that converts camel-case keys to snake-case keys.

case useDefaultKeys

A key encoding strategy that doesn't change key names during encoding.

Custom Encoding

case custom(@escaping ([CodingKey]) -> CodingKey)

A key encoding strategy defined by the closure you supply.

See Also

Customizing Encoding

var outputFormatting: JSONEncoder.OutputFormatting

A value that determines the readability, size, and element order of the encoded JSON object.

struct JSONEncoder.OutputFormatting

The output formatting options that determine the readability, size, and element order of an encoded JSON object.

var keyEncodingStrategy: JSONEncoder.KeyEncodingStrategy

A value that determines how a type's coding keys are encoded as JSON keys.

var userInfo: [CodingUserInfoKey : Any]

A dictionary you use to customize the encoding process by providing contextual information.