Skip to content
Snippets Groups Projects
Commit 5c455732 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add some documentation

parent 014027c2
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!52Workaround for big numbers in JSONs
This commit is part of merge request !52. Comments created here will be created in the context of that merge request.
import Foundation
/// Replaces all numbers at provided key with string equivalents
///
/// Example input:
/// {
/// "key": 123,
/// "object": {
/// "hello": "world",
/// "key": 321
/// }
/// }
///
/// Example output:
/// {
/// "key": "123",
/// "object": {
/// "hello": "world",
/// "key": "321"
/// }
/// }
///
/// - Parameters:
/// - input: JSON data
/// - key: the key which values should be converted
/// - Returns: JSON data
func convertJsonNumberToString(
in input: Data,
at key: String
......@@ -18,6 +42,30 @@ func convertJsonNumberToString(
return output
}
/// Replaces all strings at provided key with number equivalents
///
/// Example input:
/// {
/// "key": "123",
/// "object": {
/// "hello": "world",
/// "key": "321"
/// }
/// }
///
/// Example output:
/// {
/// "key": 123,
/// "object": {
/// "hello": "world",
/// "key": 321
/// }
/// }
///
/// - Parameters:
/// - input: JSON data
/// - key: the key which values should be converted
/// - Returns: JSON data
func convertJsonStringToNumber(
in input: Data,
at key: String
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment