Skip to content

Conversation

@kittywaresz
Copy link
Contributor

@kittywaresz kittywaresz commented Nov 2, 2025

Fix bug in AsyncAPI schema

No extra "Subscribe" suffix in AsyncAPI operations object if title parameter was specified explicitly during subscriber creation

Fixes #2617

Type of change

Please delete options that are not relevant.

  • Bug fix (a non-breaking change that resolves an issue)

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

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Nov 2, 2025
@kittywaresz kittywaresz changed the title Issue-2617: Fix bug in AsyncAPI schema Fix bug in AsyncAPI schema Nov 2, 2025
@kittywaresz
Copy link
Contributor Author

Please take a look at #2617 (comment) before review

Copy link
Member

@Lancetnik Lancetnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but this is an incorrect solution. We should add the "Subscribe" suffix to the handlers' name in the default case. However, if the user creates a subscriber with a manual name assignment, such as broker.subscriber(..., title="some-title"), we should set it up as is, without any mangling.

Also, please revert any changes doesn't relate to the Issue

assert schema["channels"][channel_key]["address"] == "/"

assert next(iter(schema["operations"].keys())) == ".Subscribe"
assert operation_key == ".Subscribe"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that title="/" is a special case and we need mangling here

@kittywaresz kittywaresz requested a review from Lancetnik November 2, 2025 20:39
@kittywaresz kittywaresz requested a review from Lancetnik November 7, 2025 14:53
Removed assertions checking for channel and operation keys in the schema.
Lancetnik
Lancetnik previously approved these changes Nov 7, 2025
@Lancetnik
Copy link
Member

@kittywaresz can you please fix CI?

@kittywaresz
Copy link
Contributor Author

@Lancetnik fixed

Can you please check my old comment #2439 (comment)? It seems that pre-commit action not configured properly, I think it should be able to commit changes to fix simple issues like this one

@Lancetnik
Copy link
Member

@Lancetnik fixed

Can you please check my old comment #2439 (comment)? It seems that pre-commit action not configured properly, I think it should be able to commit changes to fix simple issues like this one

Yes, but I don't know, how to configure it correctly:
Previously we had two edge cases

  1. It commits, but doesn't fail in cases can't fix
  2. It fails, but can't commit

@Lancetnik Lancetnik added this pull request to the merge queue Nov 11, 2025
Merged via the queue into ag2ai:main with commit cce5bf3 Nov 11, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: additional "Subscribe" in docs

2 participants