Structure
AnyDecodable
@dynamicMemberLookup
public struct AnyDecodable
A struct
defining an instance
capable of parsing some generic
JSON file.
Relationships
Conforms To
CustomDebugStringConvertible
CustomStringConvertible
Decodable
Initializers
init(from:)
public init(from decoder: Decoder) throws
Init.
Parameters
Name | Type | Description |
---|---|---|
decoder | Decoder |
Some |
Throws
A DecodingError
.
Properties
Methods
fromSnakeCase()
public func fromSnakeCase() -> AnyDecodable
Change all keys to be decoded using camel case.
"some_key" -> "someKey".
Returns
Some AnyDecodable
.
fromSnakeCase(_:)
public func fromSnakeCase(_ shouldConvertFromSnakeCase: Bool) -> AnyDecodable
Change all keys to be decoded using camel case.
"some_key" -> "someKey".
Parameters
Name | Type | Description |
---|---|---|
shouldConvertFromSnakeCase | Bool |
Whether it should convert to camel case or not (e.g. "some_key" to "someKey"). |
Returns
Some AnyDecodable
.