# Data formats in Orbital

> Data formats in Orbital - Overview

Source: https://orbitalhq.com/docs/data-formats/overview

Data formats specify how Orbital should read and write data.

By default, Orbital assumes that data is provided as JSON. However, by adding a Data Format to a model, this 
can be modified to any type of serialization format.

## API Specs and Message formats
Some API specs which define transport also have their own message format (eg., Protobuf).  If that's the
case, you generally don't need to do anything - Orbital applies the correct formats when parsing the API spec.

| API Spec | Message Format | Docs                                                    |
|----------|----------------|---------------------------------------------------------|
| Protobuf | Protobuf       | [Protobuf docs](/docs/describing-data-sources/protobuf) |
| OpenAPI  | Json           | [OpenAPI docs](/docs/describing-data-sources/open-api)  |
| SOAP     | XML            | [SOAP docs](/docs/describing-data-sources/soap)         |
| Avro     | Avro           | [Avro docs](/docs/data-formats/avro)         |

## Using message formats in Taxi

If you're using Taxi to describe your API specs, you need to specify the data format that is used for reading/writing messages.

By default, messages are expected to be in JSON.  Other formats can be specified using an annotation on the top level type.

For example:

```taxi
> import com.orbitalhq.formats.Xml
  
> @Xml
  model Person {
    firstName : FirstName
  }
```

You only need to apply the annotation to the top level entity.

| Message format | Annotation                                        | Links                                                                            |
|----------------|---------------------------------------------------|----------------------------------------------------------------------------------|
| Json           | Not needed - default format                       | -                                                                                |
| Xml            | `com.orbitalhq.formats.Xml`                       | [Xml annotation docs](/docs/data-formats/xml)                                    |
| Csv            | `com.orbitalhq.formats.Csv`                       | [Csv annotation docs](/docs/data-formats/csv)                                    |
| Protobuf       | Not supported in Taxi - Use a protobuf spec       | [File an issue to request support](https://github.com/orbitalapi/orbital/issues) |
| Avro           | Not supported directly in Taxi - Use an Avro spec | [File an issue to request support](https://github.com/orbitalapi/orbital/issues) |

## Defining custom formats
Internally, Orbital uses a [ModelFormatSpec](https://github.com/orbitalapi/orbital/blob/develop/vyne-core-types/src/main/java/com/orbitalhq/models/format/ModelFormatSpec.kt) to provide
format-specific serialization & deserialization implementations.

While it is possible to define your own custom format, to load it into Orbital currently requires a custom build - available for Enterprise customers only.

Support for loading custom formats via Taxi projects is planned - Vote for [this issue](https://github.com/orbitalapi/orbital/issues/8) or [reach out to us](https://join.slack.com/t/orbitalapi/shared_invite/zt-697laanr-DHGXXak5slqsY9DqwrkzHg) if you'd like to discuss getting this feature supported.
