Skip to content

feat: Add Try It Out feature for AsyncAPI documentation#2777

Merged
Lancetnik merged 23 commits intoag2ai:mainfrom
vvlrff:asyncapi-post-form
Feb 28, 2026
Merged

feat: Add Try It Out feature for AsyncAPI documentation#2777
Lancetnik merged 23 commits intoag2ai:mainfrom
vvlrff:asyncapi-post-form

Conversation

@vvlrff
Copy link
Contributor

@vvlrff vvlrff commented Feb 21, 2026

Description

Adds a built-in Try It Out feature to the AsyncAPI documentation page hosted via AsgiFastStream. Users can now publish test messages directly from the browser UI without leaving the docs.

When asyncapi_path is set, a companion POST endpoint is automatically registered at {asyncapi_path}/try. By default it routes messages through TestBroker (in-memory, no real broker connection required). A toggle in the UI also allows sending to the real broker when needed.

The endpointBase URL for the UI can be overridden via AsyncAPI(try_it_out_endpoint_base=...) — useful when pointing the UI at a separate backend or production URL.

Type of change

  • Documentation (typos, code examples, or any documentation updates)
  • Bug fix (a non-breaking change that resolves an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a fix or feature that would disrupt existing functionality)
  • This change requires a documentation update

Checklist

  • My code adheres to the style guidelines of this project (just lint shows no errors)
  • I have conducted a self-review of my own code
  • I have made the necessary changes to the documentation
  • My changes do not generate any new warnings
  • I have added tests to validate the effectiveness of my fix or the functionality of my new feature
  • Both new and existing unit tests pass successfully on my local environment by running just test-coverage
  • I have ensured that static analysis tests are passing by running just static-analysis
  • I have included code examples to illustrate the modifications

… registration (ag2ai#2775)

- Enhanced AsyncAPI documentation to include a Try It Out feature, allowing users to publish test messages directly from the browser UI.
- Registered a POST endpoint at `{asyncapi_path}/try` for publishing messages in test mode.
- Updated `AsgiFastStream` to accept a `try_it_out` parameter for enabling/disabling the feature.
- Implemented `TryItOutProcessor` to handle message publishing and validation.
- Added tests to verify the functionality of the Try It Out feature, including endpoint registration and message delivery.
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 21, 2026
vvlrff and others added 10 commits February 26, 2026 22:59
- Introduced asyncapi_js_react_url parameter in make_asyncapi_asgi, AsyncAPIRoute, and get_asyncapi_html functions to support React-based rendering.
- Updated logic to utilize asyncapi_js_react_url when the Try It Out feature is enabled, enhancing flexibility in AsyncAPI documentation rendering.
@vvlrff vvlrff requested a review from Lancetnik February 28, 2026 14:13
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Feb 28, 2026
Lancetnik
Lancetnik previously approved these changes Feb 28, 2026
Lancetnik and others added 3 commits February 28, 2026 23:26
erge branch 'asyncapi-post-form' of github.com:vvlrff/faststream into asyncapi-post-form
Lancetnik
Lancetnik previously approved these changes Feb 28, 2026
@Lancetnik Lancetnik enabled auto-merge February 28, 2026 20:39
@Lancetnik Lancetnik added this pull request to the merge queue Feb 28, 2026
Merged via the queue into ag2ai:main with commit 446b58c Feb 28, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants