<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/JSONSerialization/ReadingOptions",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSJSONReadingOptions"
  },
  "title" : "JSONSerialization.ReadingOptions"
}
-->

# JSONSerialization.ReadingOptions

Options used when creating Foundation objects from JSON data.

```
struct ReadingOptions
```

## Overview

Use these options when parsing JSON with [`jsonObject(with:options:)`](/documentation/Foundation/JSONSerialization/jsonObject(with:options:)-8demi) and [`jsonObject(with:options:)`](/documentation/Foundation/JSONSerialization/jsonObject(with:options:)-3afap).

## Topics

### Creating a Reading Options Instance

[`init(rawValue:)`](/documentation/Foundation/JSONSerialization/ReadingOptions/init(rawValue:))

Creates a set of JSON formatting options from an integer that represents those options.

### Reading Options

[`mutableContainers`](/documentation/Foundation/JSONSerialization/ReadingOptions/mutableContainers)

Specifies that arrays and dictionaries in the returned object are mutable.

[`mutableLeaves`](/documentation/Foundation/JSONSerialization/ReadingOptions/mutableLeaves)

Specifies that leaf strings in the JSON object graph are mutable.

[`fragmentsAllowed`](/documentation/Foundation/JSONSerialization/ReadingOptions/fragmentsAllowed)

Specifies that the parser allows top-level objects that aren’t arrays or dictionaries.

[`json5Allowed`](/documentation/Foundation/JSONSerialization/ReadingOptions/json5Allowed)

Specifies that reading serialized JSON data supports the JSON5 syntax.

[`topLevelDictionaryAssumed`](/documentation/Foundation/JSONSerialization/ReadingOptions/topLevelDictionaryAssumed)

Specifies that the parser assumes the top level of the JSON data is a dictionary, even if it doesn’t begin and end with curly braces.

[`allowFragments`](/documentation/Foundation/JSONSerialization/ReadingOptions/allowFragments)

A deprecated option that specifies that the parser should allow top-level objects that aren’t arrays or dictionaries.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)