Skip to content

Commit

Permalink
Encode quiz using kebab case keys
Browse files Browse the repository at this point in the history
  • Loading branch information
rwbutler committed Sep 3, 2020
1 parent 7aa7eb5 commit 3ea07f7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions code/SwiftQuiz.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public class SwiftQuiz {
let factory = QuizFactory(model: model)
let quiz = try factory.manufacture()
let encoder = JSONEncoder()
encoder.keyEncodingStrategy = .convertToKebabCase
var outputData = try encoder.encode(quiz)
if let key = key?.data(using: .utf8) {
outputData = EncryptedData(message: outputData, key: key, algorithm: .aes256).data()
Expand Down

0 comments on commit 3ea07f7

Please sign in to comment.