[android-components](../../index.md) / [mozilla.components.service.fretboard](../index.md) / [JSONExperimentParser](index.md) / [toJson](./to-json.md)

# toJson

`fun toJson(experiment: `[`Experiment`](../-experiment/index.md)`): `[`JSONObject`](https://developer.android.com/reference/org/json/JSONObject.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/service/fretboard/src/main/java/mozilla/components/service/fretboard/JSONExperimentParser.kt#L63)

Converts the specified experiment to json

### Parameters

`experiment` - experiment to convert

**Return**
json representation of the experiment

