Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: default call_name for broker.subscriber if there no any subscriber function #1588

Closed
Lancetnik opened this issue Jul 10, 2024 · 1 comment · Fixed by #1589
Closed
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Lancetnik
Copy link
Member

Now AsyncAPI raises an error if you try to generate schema with subscriber without any handler function. We should add a default name for that case.

@Lancetnik Lancetnik added enhancement New feature or request good first issue Good for newcomers labels Jul 10, 2024
@Lancetnik
Copy link
Member Author

I think, we can just refactor this method as the follows:

@property
def call_name(self) -> str:
    """Returns the name of the handler call."""
    if not self.calls:
        return "Subscriber"

    else:
        return to_camelcase(self.calls[0].call_name)

But, we should add the test for it to this case: https://github.com/airtai/faststream/blob/main/tests/asyncapi/base/naming.py#L15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant