[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)`): <ERROR CLASS>` [(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

