Working with other API specs

Language Interoperability

Overview

Taxi is designed to work alongside your existing schema languages and API specifications rather than replace them. By adding semantic metadata to your existing specs, you create a semantic layer that connects data across different systems and formats.

Enhancement, Not Replacement

Teams can continue using their preferred schema formats and toolchains. Taxi adds semantic meaning through lightweight metadata annotations.

Supported Formats

OpenAPI/Swagger

Add semantic types to your REST APIs using x-taxi-type extensions:

paths:
  /customers/{id}:
    get:
      parameters:
        - name: id
          schema:
            type: string
            x-taxi-type:
              name: acme.CustomerId

Open API reference

Protocol Buffers

Enhance protocol buffer messages using the taxi.dataType extension:

message Customer {
  optional string id = 1 [(taxi.dataType)="acme.CustomerId"];
  optional string email = 2 [(taxi.dataType)="acme.EmailAddress"];
}

Protobuf reference

Avro

Add semantic meaning to Avro schemas via the taxi.dataType attribute:

{
  "type": "record",
  "name": "Customer",
  "fields": [
    {
      "name": "id",
      "type": "string",
      "taxi.dataType": "acme.CustomerId"
    }
  ]
}

Avro reference

SOAP/WSDL

Enhance SOAP services using the taxi:type attribute:

<xs:element name="GetCustomerRequest">
   <xs:complexType>
      <xs:sequence>
         <xs:element name="customerId" type="xs:string"
>           taxi:type="acme.CustomerId"/>
      </xs:sequence>
   </xs:complexType>
</xs:element>

Soap reference

Data Formats

Taxi also provides annotations for common data formats.

Taxi includes annotations for common data formats like CSV and XML, enabling schema definitions for formats that may not have formal specifications.

While Taxi defines these formats, the actual reading and writing of data is handled by TaxiQL query engines, such as Orbital

CSV

@Csv(delimiter = "|")
model CustomerExport {
   id: CustomerId
   email: EmailAddress
}

Csv reference

XML

@Xml
model CustomerImport {
   @XmlAttribute
   id: CustomerId
   email: EmailAddress
}

Xml reference

Previous
Taxi Stdlib
Next
Open API