> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# JSONCoder

> Swift Protocol

**Protocol**

```swift theme={null}
protocol JSONCoder : Sendable
```

## Instance Methods

### decode(\_:from:)

```swift theme={null}
func decode<T>(_ type: T.Type, from data: Data) throws(CrossmintServiceError) -> T where T : Decodable
```

### encode(\_:)

```swift theme={null}
func encode<T>(_ instance: T) throws(CrossmintServiceError) -> Data where T : Encodable
```

### encodeRequest(\_:errorType:)

```swift theme={null}
func encodeRequest<T, E>(_ request: T, errorType: E.Type) throws(E) -> Data where T : Encodable, E : ServiceError
```
