Martini Generating Services when Consuming AsyncAPI
Martini's graphical interface simplifies the service generation process from AsyncAPI specifications, facilitating the creation of services for asynchronous messaging patterns. This guide provides step-by-step instructions using the Martini GUI as seen in the provided image.
Steps to Generate Services from an AsyncAPI Specification
-
Open the 'Consume API' Dialog
- In the Martini interface, open the 'Consume an API' dialog which is the starting point for generating new services.
-
Specify the Location
- In the 'Location' field, enter the directory within your Martini package where the generated services will reside. For example:
/demo-api-crm/code
.
- In the 'Location' field, enter the directory within your Martini package where the generated services will reside. For example:
-
Choose the AsyncAPI Option
- From the list of available API types, select 'AsyncAPI'. This tells Martini that you're going to generate services based on an AsyncAPI specification.
-
Provide the AsyncAPI Specification
- In the 'File/URL' field, input the location of your AsyncAPI specification. This can be done by dropping a file directly into the interface, browsing to a file's location, or entering a URL where the AsyncAPI specification is hosted.
-
Logging (Optional)
- If you wish to log requests for tracking and debugging purposes, check the 'Log requests to Tracker' option.
-
Generate the Services
- After providing all necessary information and configurations, click the 'Consume' button to instruct Martini to generate services based on the AsyncAPI specification.
Post-Generation Steps
After the services have been generated, it is recommended to:
- Review the Generated Services: Analyze the created services for accuracy and completeness based on the AsyncAPI specification.
- Customize as Necessary: Modify the service logic, input, and output to align with your business requirements.
- Test the Services: Ensure that the services interact correctly with the asynchronous API by conducting thorough tests within Martini.