Fork me on GitHub
Cougar

BSIDL Reference

Overview

The Betfair Service Interface Definition Language (Betfair Service IDL or BSIDL for short) is an XML-based DSL (domain specific language) for describing versioned service interfaces. The DSL uses a combination of ideas taken from Thrift with additional support for events and information on users of interfaces.

The format allows us to fully describe the methods, request/response parameters, exceptions as well as events and all documentation associated with these entities.

It is the main input into the Maven Cougar Codegen Plugin.

Benefits

Types

The base types supported by the IDL are as follows:

Note that generics are specified with ‘()’ rather than ‘<>’ as chevrons break the xml and are a pain to delimit.

File structure reference

Note that a document describing an interface is an interface definition document (IDD) and is written in the interface definition language (BSIDL). It may directly contain extensions or these may be specified in a seperate extensions document.

Main IDD (Interface.xml):


  <interface>
    <authors>
      <author/>
    </authors>
    <description/>
    <operation>
      <description/>
      <parameters>
        <request>
          <parameter>
            <description/>
            <validValues>
              <value>
                <description/>
              </value>
            </validValues>
          </parameter>
        </request>
        <response>
          <description/>
        </response>
        <exceptions>
          <exception>
            <description/>
          </exception>
        </exceptions>
      </parameters>
    </operation>
    <event>
      <description/>
      <parameter>
        <description/>
        <validValues>
          <value>
            <description/>
          </value>
        </validValues>
      </parameter>
    </event>
    <exceptionType>
      <description/>
      <parameter>
        <description/>
        <validValues>
          <value>
            <description/>
          </value>
        </validValues>
      </parameter>
    </dataType>
    <dataType>
      <description/>
      <parameter>
        <description/>
        <validValues>
          <value>
            <description/>
          </value>
        </validValues>
      </parameter>
    </dataType>
    <simpleType>
      <description/>
      <validValues>
        <value>
          <description/>
        </value>
      </validValues>
    </simpleType>
  </interface>

IDD Extensions (Interface-Extensions.xml):


  <interface>
    <operation>
      <parameters>
        <request>
          <parameter>
            <extensions>
              <style/>
            </extensions>
          </parameter>
        </request>
      </parameters>
      <extensions>
        <path/>
        <method/>
      </extensions>
    </operation>
    <event>
      <parameter>
        <extensions>
          <style/>
        </extensions>
      </parameter>
    </event>
  	<extensions>
  		<path/>
  	</extensions>
  </interface>

<interface>

The interface element describes the top-level attributes of service interface defined by this IDD.

<?xml version="1.0" encoding="utf-8"?>
<interface name="Test" owner="Joe Bloggs" version="0.1" date="01/01/1970">
    <authors>
        <author name="Joe Bloggs" email="joe@bloggs.com"/>
    </authors>
    <description>This is here to provide an example of all features in order for tests to be made</description>
</interface>

The attributes are explained in more detail: * name: The name of the service, this should match exactly with the file name without file extension (e.g. filename: FooBar.xml corresponds to name: FooBar). * owner: The person who should be contacted with any queries regarding this service interface, in many cases one of the authors but this isn’t necessary. * version: The version of the interface - please see versioning. * date: The date that the interface version was frozen - in development service interface can use the now() function that will insert the current date time - the date should be formatted as an [[ISO 8601 date|http://en.wikipedia.org/wiki/ISO_8601]] in UTC.

The description element provides a description of the interface (usually in English).

#### Supported extensions

TODO

<authors>

The authors element must contain one or more author elements which give a name and email address for each author.

<operation>

#### Supported extensions

<parameter>

#### Supported extensions

<response>

<exception>

<event>

<exceptionType>

<dataType>

<simpleType>