---
title: "isValidJSONObject(_:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/jsonserialization/isvalidjsonobject(_:)"
---

# isValidJSONObject(_:)

Returns a Boolean value that indicates whether the serializer can convert a given object to JSON data.

## Declaration

```swift
class func isValidJSONObject(_ obj: Any) -> Bool
```

## Parameters

- `obj`: The object to test.

## Return Value

Return Value true if obj can be converted to JSON data; otherwise, false.

## See Also

### Creating JSON Data

- [data(withJSONObject:options:)](foundation/jsonserialization/data(withjsonobject:options:).md)
- [writeJSONObject(_:to:options:error:)](foundation/jsonserialization/writejsonobject(_:to:options:error:).md)
- [JSONSerialization.WritingOptions](foundation/jsonserialization/writingoptions.md)
