<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/JSONSerialization/ReadingOptions/topLevelDictionaryAssumed",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSJSONReadingOptions@NSJSONReadingTopLevelDictionaryAssumed"
  },
  "title" : "topLevelDictionaryAssumed"
}
-->

# 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.

```
static var topLevelDictionaryAssumed: JSONSerialization.ReadingOptions { get }
```

## Discussion

This is an extension to JSON5 that isn’t part of the specification. [`AttributedString`](/documentation/Foundation/AttributedString) uses this option, along with [`json5Allowed`](/documentation/Foundation/JSONSerialization/ReadingOptions/json5Allowed), to support the use of JSON5 inside Markdown strings that use multiple custom attributes. Using [`topLevelDictionaryAssumed`](/documentation/Foundation/JSONSerialization/ReadingOptions/topLevelDictionaryAssumed) allows for the following syntax in the parentheses of the custom attribute markup:

```other
This is a [Markdown](https://commonmark.org) string with a ^[custom attribute](factor: 10, other: true).
```

Without [`topLevelDictionaryAssumed`](/documentation/Foundation/JSONSerialization/ReadingOptions/topLevelDictionaryAssumed), the markup would have to use explicit enclosing braces to declare the contents of the parentheses to be a dictionary:

```other
This is a [Markdown](https://commonmark.org) string with a ^[custom attribute]({factor: 10, other: true}).
```

When you use braces, you must use matched pairs. This means that with [`topLevelDictionaryAssumed`](/documentation/Foundation/JSONSerialization/ReadingOptions/topLevelDictionaryAssumed) set, the syntax `({…})` and `(…)` are both legal, but `({…)` and `(…})` are not.

---

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)