Skip to content

Commit

Permalink
Allow fragments when deserializning from data via JSONDecoder
Browse files Browse the repository at this point in the history
  • Loading branch information
kdubb committed May 16, 2021
1 parent e3a1600 commit 876ff4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/PotentJSON/JSONDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public struct JSONDecoderTransform: InternalDecoderTransform, InternalValueDeser
}

public static func value(from data: Data, options: Options) throws -> JSON {
return try JSONSerialization.json(from: data)
return try JSONSerialization.json(from: data, options: [.allowFragments])
}

public static func value(from string: String, options: Options) throws -> JSON {
Expand Down

0 comments on commit 876ff4a

Please sign in to comment.