Skip to content

Martini Generating Services when Consuming AsyncAPI APIs

Martini's graphical interface streamlines the creation of services from AsyncAPI schemas, facilitating quick integration with AsyncAPI APIs. Follow these steps to generate services in Martini from a AsyncAPI schema.

Importing an AsyncAPI Schema

  1. Navigate to the Consume API Interface: In Martini, open the Navigator view.

  2. Start the Consume API Wizard: Right-click on your target package and select “New | Consume API” from the context menu to launch the Consume an API wizard.

  3. Complete the Required Values:

  4. Location: Browse to the directory within your package where you would like your generated services saved.

  5. Source: Select AsyncAPI
  6. File/URL: Provide the file path or enter the URL for the AsyncAPI schema.

  7. Optional Settings: To track events in the Tracker Transaction log, check "Log requests to Tracker." Note that logging to the Tracker may add overhead and consume additional database resources.

  8. Complete the Import: Click “Consume” to generate services from the AsyncAPI API specification. Martini will generate a service for each operation defined in the API specification, saving them to the specified directory.

Post-Generation Steps

After generating the services, you may need to take additional steps:

  • Customize Generated Services: Review the autogenerated service components and customize queries, mutations, or subscriptions as needed to suit your business logic.
  • Test Services: Invoke the generated services and ensure they interact with the AsyncAPI API as expected.
  • Secure the Services: If your AsyncAPI API requires authentication, ensure that the necessary headers or tokens are configured in the authentication service inputs.