Skip to content

Commit

Permalink
Merge pull request Moya#2320 from Gobans/master
Browse files Browse the repository at this point in the history
Change deprecated option in JSONSerialization
  • Loading branch information
AndrewSB authored Feb 1, 2024
2 parents e25e3ab + cce7e0e commit 8223424
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Moya/Response.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public extension Response {
/// whether the mapping should fail if the data is empty.
func mapJSON(failsOnEmptyData: Bool = true) throws -> Any {
do {
return try JSONSerialization.jsonObject(with: data, options: .allowFragments)
return try JSONSerialization.jsonObject(with: data, options: .fragmentsAllowed)
} catch {
if data.isEmpty && !failsOnEmptyData {
return NSNull()
Expand Down

0 comments on commit 8223424

Please sign in to comment.