---
title: fragmentsAllowed
framework: foundation
role: symbol
role_heading: Type Property
path: foundation/jsonserialization/writingoptions/fragmentsallowed
---

# fragmentsAllowed

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

## Declaration

```swift
static var fragmentsAllowed: JSONSerialization.WritingOptions { get }
```

## See Also

### Formatting JSON

- [prettyPrinted](foundation/jsonserialization/writingoptions/prettyprinted.md)
- [sortedKeys](foundation/jsonserialization/writingoptions/sortedkeys.md)
- [withoutEscapingSlashes](foundation/jsonserialization/writingoptions/withoutescapingslashes.md)
