Skip to content

Home

Development

IDEs

API Explorer

Releases

Release notes

Martini Runtime

Martini Desktop

Martini Online

Feature requests

Bug reports

Consuming an API schema

When you consume an API schema in Martini, a Gloop service is generated for every web service /operation defined in the schema. You can then use these generated services to build your applications. This process also produces associated Gloop models and a Gloop API (optional), for cases where you want to publish the consumed API in Martini. Martini supports the following API schemas for consumption:

To generate Gloop services from an API schema:

Generating Gloop services from a Swagger file

Generating Gloop services from a Swagger file

  1. Launch the Gloop API wizard.

    1. Go to the Navigator view.
    2. Right click on your target package's code folder or any of the code directories under it where you'd like your services to reside.
    3. Select New, then select Gloop API.

    Launch the wizard using keyboard shortcuts only

    You can open the Gloop API wizard by pressing ( in Martini Online), typing "api" in the appearing dialog's search box, and selecting Gloop API from the appearing options.

  2. Select Consume as the Type if you want to consume the API defined in the schema; Publish if you wish to have Martini host the schema as a new SOAP or REST API. Click Next.

  3. Specify your source API schema.
    1. Browse for the API specification document in the file system or enter its URL in the text box.
    2. Specify your API schema's type by selecting any of the options in Source, if Coder hasn't selected the correct one for you.
  4. Specify if you want to log your services' requests to Tracker.
  5. Click Finish.
Consuming a secured API schema

Martini supports two ways to secure a RESTful API: basic authentication and OAuth2. Requests to secured RESTful APIs require authentication credentials in order to gain access. These credentials are validated by the server per request.

When consuming a secured API schema, generated Gloop services will have corresponding input properties and a value to the authType property will be provided. These properties will be used to the specify type of authentication required by the API.

Gloop service from a consumed secured API schema

Gloop service from a consumed secured API schema

Swagger v2.0

The Swagger specification is a format used to describe and document RESTful APIs. Swagger is a popular choice amongst developers and companies primarily because of the following benefits, mentioned in the article "What is Swagger and Why it Matters":

  • It's comprehensible for developers and non-developers.
  • It's human readable and machine readable.
  • It's easily adjustable.

Companies like Netflix, IBM, and Yelp have already incorporated it into their own infrastructure and platform.

OpenAPI v3.0

The OpenAPI specification (formerly known as the Swagger specification) is a format used to describe and document RESTful APIs.

The OpenAPI specification is overseen by the OpenAPI Initiative which aims to standardize API descriptions. Google, Microsoft, and IBM are members of this initiative.

Postman collection

The Postman collection format is the API format for use with Postman.

Postman collection version

Martini only supports v2.1 of the Postman collection format. If you encounter errors or have a collection file that's not v2.1, you can:

  1. Import the collection into Postman.
  2. Export the collection again, choosing Collection v2.1 as the format.

Postman collection export dialog

WSDL

WSDL (Web Services Description Language Version) provides a model and an XML configuration used for describing web services.

WADL

WADL (Web Application Description Language) is scheme that provides a machine-readable definition of HTTP-based web applications.

RAML

RAML stands for RESTful API Modeling Language. It's a YAML-based language used for describing RESTful APIs in a way that's highly machine and human readable.