StackOverflow Questions for Tag: codable

zekel
zekel

Reputation: 9467

With JSONDecoder in Swift 4, can missing keys use a default value instead of having to be optional properties?

Score: 184

Views: 77935

Answers: 9

Read More
Kitty
Kitty

Reputation: 21

Date string does not match format expected by formatter (SwiftData). Is it a problem with my @model and the codingKeys?

Score: 2

Views: 123

Answers: 1

Read More
James Sumners
James Sumners

Reputation: 14785

Create a custom Date class/struct that inherits from Date/NSDate?

Score: 0

Views: 135

Answers: 3

Read More
Lucas Drouot
Lucas Drouot

Reputation: 116

Store a Codable in a properties file with custom extension - Swift

Score: 0

Views: 12

Answers: 0

Read More
salazar44
salazar44

Reputation: 142

Having trouble with my API Request. Curl Method with 2 headers

Score: 0

Views: 130

Answers: 1

Read More
laneboyandrew
laneboyandrew

Reputation: 343

Decode response with headers and body using init from decoder

Score: 0

Views: 43

Answers: 0

Read More
matrejek
matrejek

Reputation: 473

How to mimic codable CodingKey in custom encoding

Score: 0

Views: 47

Answers: 1

Read More
zoul
zoul

Reputation: 104095

How can I use Swift’s Codable to encode into a dictionary?

Score: 174

Views: 148917

Answers: 16

Read More
Murali Murugan
Murali Murugan

Reputation: 43

Codable default values during initialization

Score: 2

Views: 3260

Answers: 2

Read More
Khriapin Dmitriy
Khriapin Dmitriy

Reputation: 1822

Swift JSONDecode decoding arrays fails if single element decoding fails

Score: 172

Views: 103561

Answers: 16

Read More
user3524311
user3524311

Reputation: 31

Swift JSON Decoding error wth coding Key usage

Score: -1

Views: 87

Answers: 1

Read More
LucaRoverelli
LucaRoverelli

Reputation: 1177

Codable enum with default case in Swift 4

Score: 75

Views: 35469

Answers: 12

Read More
zemirco
zemirco

Reputation: 16395

How to handle partially dynamic JSON with Swift Codable?

Score: 18

Views: 5118

Answers: 1

Read More
Yee468
Yee468

Reputation: 1

Save decoded data from backend as property of custom struct

Score: 0

Views: 60

Answers: 0

Read More
Ruchira More
Ruchira More

Reputation: 281

iOS error 'Invalid type in JSON write (FIRTimestamp)'

Score: 7

Views: 2104

Answers: 4

Read More
LeTadas
LeTadas

Reputation: 3556

Swift keep order while converting to JSON using JSONEncoder

Score: 6

Views: 2203

Answers: 1

Read More
Haravikk
Haravikk

Reputation: 3290

JSONEncoder won't allow type encoded to primitive value

Score: 5

Views: 7590

Answers: 2

Read More
user8474913
user8474913

Reputation: 53

How to display JSON data from API?

Score: -1

Views: 753

Answers: 2

Read More
vgvishesh23113
vgvishesh23113

Reputation: 319

How to parse nested JSON in swift?

Score: -3

Views: 3480

Answers: 2

Read More
Afsara
Afsara

Reputation: 1461

Cannot automatically synthesize 'Encodable' because 'Error' does not conform to 'Encodable'

Score: 0

Views: 1761

Answers: 1

Read More
PreviousPage 1Next