Skip to content

fix: Bug: AsyncAPI documentation fails when Confluent uses oauth bearer authentication#2775

Merged
Lancetnik merged 1 commit intoag2ai:mainfrom
yann-combarnous:fix/2774
Feb 19, 2026
Merged

fix: Bug: AsyncAPI documentation fails when Confluent uses oauth bearer authentication#2775
Lancetnik merged 1 commit intoag2ai:mainfrom
yann-combarnous:fix/2774

Conversation

@yann-combarnous
Copy link
Contributor

@yann-combarnous yann-combarnous commented Feb 19, 2026

Fixes #2774

Description

This fixes a FastStream AsyncAPI schema generation bug for SASLOAuthBearer where securitySchemes.oauthbearer was emitted as {"type":"oauth2","$ref":""}.
An empty $ref is invalid and causes AsyncAPI React to attempt file resolution (readFile), leading to a runtime docs error.

Fixes #2774

Type of change

Please delete options that are not relevant.

  • 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

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Lancetnik
Copy link
Member

Thank you!

@Lancetnik Lancetnik enabled auto-merge February 19, 2026 15:55
@Lancetnik Lancetnik added this pull request to the merge queue Feb 19, 2026
Merged via the queue into ag2ai:main with commit ebc4739 Feb 19, 2026
27 of 28 checks passed
vvlrff added a commit to vvlrff/faststream that referenced this pull request Feb 21, 2026
… 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-merge-queue bot pushed a commit that referenced this pull request Feb 28, 2026
* feat: Add Try It Out feature for AsyncAPI documentation with endpoint registration (#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.

* style: Refactor code for better readability and formatting in AsyncAPIRoute and test cases

* refactor: polish PR

* tests: fix result validation

* feat: Enhance Try It Out feature with structured message handling and updated documentation

* style: Improve code formatting for message structure in AsyncAPI test cases

* feat: return just a result

* feat: Add asyncapi_js_react_url parameter to AsyncAPI functions

- 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.

* refactor: Simplify asyncapi_js_url assignment logic in get_asyncapi_html function

* feat: Enhance AsyncAPI functionality with new parameters and improved Try It Out processing

* fix: Update TryItOutProcessor to use set for empty check in JSONResponse

* fix: Refine TryItOutProcessor response handling and enhance test coverage for various payload types

* chore: bump version

* docs: fix markup

* docs: move TryItOut to AsyncAPI docs

* refactor: use standalone TryItOut plugin

* refactor: use unpkg AsyncAPI CDN

* lint: apply changes

---------

Co-authored-by: Nikita Pastukhov <diementros@yandex.ru>
Co-authored-by: Pastukhov Nikita <nikita@pastukhov-dev.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: AsyncAPI documentation fails when Confluent uses oauth bearer authentication

3 participants