When you first open AsyncAPI Studio, you'll see the main editor interface with the following components:
- Editor Panel: The central area where you write and edit your AsyncAPI document
- Navigation Sidebar: Access different views and tools
- Preview Panel: View documentation, visual diagrams, or generated code
- Toolbar: Access common actions like validation, saving, and sharing
Creating a New AsyncAPI Document
To create a new AsyncAPI document:
- Click on the New Document button in the toolbar
- Select the AsyncAPI version you want to use (2.0.0, 2.1.0, 2.2.0, etc.)
- Choose a template to start with (Minimal, Kafka, MQTT, etc.) or start from scratch
- Begin editing your document in the editor panel
Editing AsyncAPI Documents
The Studio editor provides several features to help you create and edit AsyncAPI documents:
Syntax Highlighting
The editor automatically highlights different parts of your AsyncAPI document to make it easier to read and understand:
- Keywords and property names
- Values and types
- References and components
- Comments and annotations
Code Completion
As you type, the editor suggests completions based on the AsyncAPI specification:
- Press Ctrl+Space (or Cmd+Space on Mac) to manually trigger suggestions
- The editor will suggest property names, values, and schema components based on the context
Error Detection
The editor validates your document in real-time and highlights errors:
- Syntax errors are marked with red squiggly underlines
- Hover over an error to see a description of the problem
- The status bar at the bottom shows the total number of errors and warnings
Validating Your AsyncAPI Document
To validate your AsyncAPI document and see detailed validation results:
- Click the Validate button in the toolbar
- The validation panel will appear showing any errors or warnings
- Click on an error to jump to its location in the document
- Fix the issues and re-validate until all errors are resolved
Converting Between AsyncAPI Versions
To convert your AsyncAPI document to a different version:
- Click on the Convert button in the toolbar
- Select the target version you want to convert to
- Review the converted document in the preview panel
- Click Apply to replace your document with the converted version, or Cancel to discard
Previewing Documentation
To see how your AsyncAPI document will be rendered as documentation:
- Click on the Preview tab in the preview panel
- The documentation will be rendered using the AsyncAPI React component
- Scroll through the preview to see all sections of your document
- The preview updates automatically as you edit your document
Visualizing Your API
To visualize the structure and message flows of your API:
- Click on the Visualize tab in the preview panel
- The visualization will show:
- Services and operations
- Message flows between components
- Message schemas and formats
- You can:
- Zoom in/out using the mouse wheel
- Drag components to rearrange the diagram
- Click on components to see their details
Generating Code
To generate code from your AsyncAPI document:
- Click on the Generate tab in the preview panel
- Select a template from the dropdown menu
- Configure any template-specific options
- Click Generate to create the code
- Download the generated code as a ZIP file
Sharing Your AsyncAPI Document
You can share your AsyncAPI document in several ways:
URL Sharing
- Click on the Share button in the toolbar
- Copy the provided URL
- Share the URL with others who can view and edit your document
File Export
- Click on the Download button in the toolbar
- Select the format you want to export to (YAML or JSON)
- Save the file to your computer or share it directly
Keyboard Shortcuts
AsyncAPI Studio provides several keyboard shortcuts to improve productivity:
Action | Windows/Linux | macOS |
---|---|---|
Save | Ctrl+S | Cmd+S |
Find | Ctrl+F | Cmd+F |
Replace | Ctrl+H | Cmd+H |
Format Document | Shift+Alt+F | Shift+Option+F |
Validate | Ctrl+Shift+V | Cmd+Shift+V |
Toggle Comment | Ctrl+/ | Cmd+/ |
Indent | Tab | Tab |
Outdent | Shift+Tab | Shift+Tab |
Best Practices
Here are some tips for effectively using AsyncAPI Studio:
- Start with a template: Use the provided templates as a starting point to save time
- Validate regularly: Validate your document frequently to catch errors early
- Use components: Define reusable schemas in the components section for better organization
- Add descriptions: Include detailed descriptions for operations, messages, and schemas
- Use examples: Provide examples for messages to help users understand the API better
- Organize your document: Use meaningful operation IDs and message names for clarity
Troubleshooting
If you encounter issues while using AsyncAPI Studio:
- Editor not loading: Try clearing your browser cache and reloading the page
- Validation errors: Check the AsyncAPI specification version you're using and ensure your document follows that version
- Preview not updating: Save your document and refresh the preview panel
- Performance issues: For large documents, consider splitting them into smaller files and using references